Using Gold Input From File

Procedure

  1. Right-click the activity from the subprocess and select Add Test > Add Assertion option.
    The Test tab is added.

    The Assertion Mode drop-down list has two options : Primitive and Activity.

    Use the Primitive option to test only the Primitive type elements.

    Use the Activity option to test the complete activity output that can contain a complex schema.

  2. Select the Activity option.
    The Gold Input From File check box is displayed.

  3. To provide the gold output through xml file, select the Gold Input From File check box.
    The assetType and testFilePath fields are displayed.

  4. Map the activity variable from datasource section to activityTestInput field.
  5. In the testFilePath field, use the doc function from the URI function and provide the input file path in the format 'file:///inputFilepath'. In the case of Unix systems, please provide the absolute path preceding with an extra forward slash. Example: doc('file:////home/Test/Mock_files/' )
  6. Provide the relative gold Input file path in the testFilePath field.
    You can create separate folder for gold input files under "Tests" folder. The relative path has value like doc file:///Tests/UnitTestingsComplex.xml. It is mandatory to provide the Tests folder name also in relative path. In case of Unix, provide the relative path as file:////Tests/Mock_files/Activity_Assetion_IP_File.xml

    Note: This feature is available with TIBCO ActiveMatrix BusinessWorks™ Maven Plugin 2.5.0 and above.

  7. To create gold input file, run the activity for which you want to add the assertions. Copy the input job data from debug console using the Copy Values option in an xml file.
  8. Change the input value with gold input values.
    Note: Linearize the copied xml data if required.