Example of Test case based on a Job
The processing part (tMap) is used to create a Test case called test_feature400 and will allow developers to test, filter, and map any types of input and output files.
Note that the generated skeleton depends on the components selected in the Job to create the Test.
-
reading input data files (tFileInputDelimited components)
-
transforming data with an immutable set of components (INPUT and OUTPUT items) based on the initial Job
-
writing the output data (to a tFileOutputDelimited component)
-
comparing the temporary output file (tCreateTemporaryFile component) to a reference file you need to define, using a tFileCompare component
-
generating the Test execution status (OK if it succeeds, Fail if it fails) using a tAssert component
Note that you can add as many instances of tests as you need, which means you can run the same test with different input and reference files.
The Test Case is ready to be executed once the data set has been defined in the Test Case view, and a specific context group (called Test) has been defined in the Context view. The data set consists of data files that you define as input and reference files to test your data.
Once developers have designed the integration tests locally in Talend Studio, these tests need to be automated with continuous integration tools such as build systems. For more information, see Building and Deploying.