Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
In the case I have to develop specific code, using specific jars, not included in Talend, I create a Maven project, the code, and package the jar. I can test my code in TDD.
However, I would like to know if there is a way to test my routines code directly in the Studio ?
I do something like what is explained here : http://bekwam.blogspot.com/2011/06/test-driven-development-and-talend-open.html
and it works but I would like to know if it can be done like in a classic Maven project.
Thank you !
Hello,
Currently when we try to build the Talend job, it is only executing the component specific test cases, not the ones written using Routines.
In Talend, you could create the routine and use some assertion for each user case(basically you created a very simple job to run the test, eg, tMap, as you're coding your routines directly in Talend, but separately from the use of that routine in ETL job).
Or You can use Eclipse to driven test and construct your routine.
Export in jar format , add jar to Talend lib or load jar file with Talend component (eg. tLibraryLoad) and Test with different user cases.
Hope it helps.
Best regards
Sabrina
Hello,
Have you looked at the build in test cases: https://help.talend.com/r/en-US/8.0/studio-user-guide-esb/ci-test-cases
It's similar to what you linked, however this automatically takes care of the JUnit test creation.
These JUnits are validated during the build.
Also there's a new concept you might not be aware:
https://help.talend.com/r/en-US/Cloud/studio-user-guide-api-services-platform/creating-custom-routine-jars
This allows you to specify multiple classes for the same set of jars.
It currently doesn't have the ability to specify a GaV but there is an internal feature request for this TUP-30674
Cheers,
Balázs
Hello @Balazs Gunics ,
Thank you for your answer.
Unfortunatelly, I use Talend Open Studio for ESB. Test case feature is not available.
Hello,
Currently when we try to build the Talend job, it is only executing the component specific test cases, not the ones written using Routines.
In Talend, you could create the routine and use some assertion for each user case(basically you created a very simple job to run the test, eg, tMap, as you're coding your routines directly in Talend, but separately from the use of that routine in ETL job).
Or You can use Eclipse to driven test and construct your routine.
Export in jar format , add jar to Talend lib or load jar file with Talend component (eg. tLibraryLoad) and Test with different user cases.
Hope it helps.
Best regards
Sabrina
Thank you for your answer Sabrina, perfect.
Question solved