Creating a Route test case - Cloud - 7.3

Talend Studio User Guide

Version
Cloud
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development
Last publication date
2024-02-13
Available in...

Cloud API Services Platform

Cloud Data Fabric

Data Fabric

Data Services Platform

ESB

MDM Platform

Real-Time Big Data Platform

To create a test case for a Route, do the following:

Procedure

  1. Open the Route for which you want to create a test case. For example, create a test case for a Route using a cTimer, a cProcessor, and a cLog component.
  2. Right-click the functional part of the Route you want to test and select Create Test Case from the contextual menu, the cLog component in this example.
  3. In the Create Test Case dialog box, enter a name for the test case in the Name field, and the optional information, if needed, such as purpose and description in the corresponding fields.
  4. Next.
    Note:

    If you clear this check box, you will need to complete the test case by adding components of your choice manually.

  5. The Define Test Skeleton details view of the wizard opens, allowing you to use a cMock or a cDataset as the message producer, and a cMock to check the result.
    When enabling the Mock first component option and using a cMock or a cDataset as the message producer, the test case will start with the testing component cMock or a cDataset. The selected component from the Route will be added behind the testing component. If you selected a message producer in the Route, it will become a consumer in the test case.
    If the Route contains any standalone component, for example, the cConfig, cBean and so on, they will be shown in the Define Test Skeleton details view of the Create Route Test Case wizard. You choose to copy them into the test case.
    Select the component you want to use and click Finish to close the wizard. The test case is then created and opened in the design workspace, with all the required components automatically added, allowing you to test any types of input and output messages.
    In the Repository tree view, the newly created test case appears under your Route.
    The generated skeleton depends on the component(s) selected in the Route to create the test case. Note that you should not change the components between the INPUT and OUTPUT items in the test case. In this example, the test case aims at:
    • generating test message exchanges and reading input test data (cTimer_1 and cMock_1 components),

    • transforming data with an immutable set of components (INPUT and OUTPUT items) based on the initial Route,

    • checking that messages have been routed as expected and validating the test output result (message content, count, header, and so on.) using the cMock_2 component.

    Depending on the number of input and output flows, a variable number of context variables are automatically created to specify the input and reference files.