One Star

[resolved] Unit testing TALEND

Hi,
I have a question concerning the unit tests TALEND.
Someone have already made the unit tests in talend,
can you give me an example of a unit test,
Please, I need you.
1 ACCEPTED SOLUTION

Accepted Solutions
Seventeen Stars

Re: [resolved] Unit testing TALEND

hi,
as Vaibhav has explained, unit test could be to test if your Talend job do the right(expected join,transformation,etc)  on your data.
So you have to test data that you already know the output (result) at the end of the Talend Job.
You can log those results thanks tAssert component :
https://help.talend.com/search/all?query=tAssert&content-lang=en
regards
laurent
6 REPLIES
Four Stars

Re: [resolved] Unit testing TALEND

Hi,
Unit tests are subjective to your job and those are not generated automatically like java coding...
What is your current job and what you want to test in it?
Vaibhav
One Star

Re: [resolved] Unit testing TALEND

thank you for answering,
My Job is to import data from one or more targets, transformed with the aggregation function using tMap example and load it into Excel files (the latter already contains rows) ...
Four Stars

Re: [resolved] Unit testing TALEND

In your case unit test could be developed as
- Manually fabricate expected output data by applying transformation on source data in excel
- Manually select transformed data into another excel file
- Design a job which has two inputs to tMap having innerjoin for all the columns and check output reject
This way you will be able to confirm that the source and target i.e. expected and actual data is matching.
Thanks
vaibhav
One Star

Re: [resolved] Unit testing TALEND

Ok, thank you very much,
Do you have an example or model of a unit test?
Seventeen Stars

Re: [resolved] Unit testing TALEND

hi,
as Vaibhav has explained, unit test could be to test if your Talend job do the right(expected join,transformation,etc)  on your data.
So you have to test data that you already know the output (result) at the end of the Talend Job.
You can log those results thanks tAssert component :
https://help.talend.com/search/all?query=tAssert&content-lang=en
regards
laurent
One Star

Re: [resolved] Unit testing TALEND

OK, thank you kzone,
I get information on my side too (with my friends)
makes unit testing is a way to test our data and see if the final result corresponds to what is expected as output.
Thank you for your help.