Running Activity Assertions using Gold Input from File TIBCO BusinessWorks™ Container Edition

To run activity assertions in TIBCO BusinessWorks Container Edition, follow these steps:

Procedure

  1. Right-click on the activity from the subprocess and select Add Test > Add Assertion.
    This will add the Test tab to the activity.
  2. On the Tests tab, navigate to the Assertion Mode drop down.

The Assertion Mode drop down has two modes:

  • Primitive: In this mode, only the primitive types of elements are tested.
  • Activity: In this mode, the complete activity outputs are tested.

  1. Select the Activity option from Assertion Mode drop down. The Gold Input From File option is displayed. To add the gold values using the XML files select the Gold Input From File check box or provide the gold values directly using the UI with editable values.
  2. Select the Gold Input From File option to provide the gold output through XML files. As shown in the image below, the activityTestInput and testFilePath fields are displayed. Map the activity variable from datasource (Mapper as seen in the image) section to activityTestInput field. In testFilePath field, use the doc function from the URI function and provide the input file path in the format file:///inputFilepath.
  3. To create gold input file, run the activity for which you need to add the assertions. Copy the input JOB data from debug console using the copy values option and paste in the XML file. Linarize the copied XML file. Change the input value with gold input values.
  4. The created gold input file displays the following content
    <tns:MapperInput 
    xmlns:tns="http://www.tibco.com/namespaces/tnt/plugins/generalactivities/mapper/1576217083039"
     xmlns:tns1="http://www.example.com/namespaces/tns/1576217149576"><name>test</name>
    <primitive>test1</primitive><elements><primitive>test2</primitive><elements>
    <primitive>test3</primitive></elements></elements></tns:MapperInput>
  5. To run the test case, see Running Unit Tests in TIBCO BusinessStudio for BusinessWorks.