Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write test case for Talend job?

I have designed a job in Talend. The job is fetching data from database and converting it into json and it uploads that json on server. I want to write test case for my job like we write unit test in java projects. I have searched a lot on how to write test case for talend job but did not find anything. If any one know how to test talend job please suggest.

like image 848
Rohit Kumar Avatar asked Jan 28 '15 09:01

Rohit Kumar


Video Answer


2 Answers

You can simply create a job which call your job (either tRunJob or tSoap if your job is soap-exposed):

  1. Init your database
  2. call your job
  3. check the result on the server (or mock the server call by overriding context parameters)
  4. use tAssert to make your check
  5. use tAssertCatcher->tLogRow to print test result

I made a CI (internal project) for our project with a basic Java application, which is a telnet wrapper around the Talend Command Line API (listJob, runJob...), then generates a Junit XML result file. Everything is called by Jenkins. It seems that nothing really exist to perfectly test Talend jobs :-(

Good luck.

like image 71
Shimbawa Avatar answered Oct 06 '22 00:10

Shimbawa


In talend 6.0.1 i found a tab named "Test Cases", it seems new to me. On https://help.talend.com/display/TalendRealtimeBigDataPlatformStudioUserGuide60EN/6.10+Testing+Jobs+using+test+cases you can find an explanation on writing such tescases. Im not sure if its what you wanted but i will have look on that.

like image 43
hilbert Avatar answered Oct 06 '22 01:10

hilbert