Using compiled versions of Routines with the Test Run feature in Talend Data Mapper

author
Talend Documentation Team
EnrichVersion
6.4
6.3
6.2
6.1
EnrichProdName
Talend Data Services Platform
Talend Big Data Platform
Talend MDM Platform
Talend Data Fabric
Talend Real-Time Big Data Platform
Talend Data Management Platform
task
Design and Development
EnrichPlatform
Talend Studio

Using compiled versions of Routines with the Test Run feature in Talend Data Mapper

You cannot test maps using the Test Run feature available in the Mapping perspective if a function that was defined in the Integration perspective under Code > Routines is called in one of the maps. Using the Test Run feature on such a map will result in errors. This issue occurs because Studio routines are not on the classpath during development. Test Run , in the Mapping perspective, has no access to the compiled versions of these routines.
Resolution

A workaround is to import a compiled version of these routines into your project.

To do so, do the following.

  1. In a command window, go to the <talend_studio_path>/workspace/.Java folder.
  2. Type mvn package .

    This creates a routines.A.B.C.jar file in <talend_studio_path>/workspace/.Java/target which contains is a compiled version of the routines.

  3. In the Studio , open the Navigator view and find your project.
  4. Right click the Project, and then click Properties > Mapping .
  5. Click Add JAR and add <talend_studio_path]/workspace/.Java/target/routines-A.B.C.jar to your project.

After this, you will be able to use the Test Run feature as required.