Skip to main content
Close announcements banner

Example of Test case based on a Job

A Job called job_feature400 is created in a project called CI. The Job aims at reading a .csv file containing a list of clients living in California, matching these clients with those coming from the Orange county of Los Angeles using a tMap component, before uploading the result into a MySQL database.

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.

Here, the Test case aims at:
  • 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.

The Test Case was successfully executed on the Test Instance and the input and reference files are identical.

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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!