Rohit Kumar
Rohit Kumar

Reputation: 1028

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.

Upvotes: 6

Views: 5510

Answers (3)

hilbert
hilbert

Reputation: 266

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.

Upvotes: 2

hopeIsTheonlyWeapon
hopeIsTheonlyWeapon

Reputation: 567

For the end to end testing we are running two versions of the job asking the user which version he needs to compare with which version and dynamically creating the table on the fly and compare the result at the db side. This is just an attempt.

Yeah there is no Junit OOB(out of the box.)

Upvotes: 0

Shimbawa
Shimbawa

Reputation: 262

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.

Upvotes: 3

Related Questions