Using Gold Input From File

    Procedure
  1. Right-click the activity from the process or 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 checkbox is displayed.

  3. To provide the gold output through an XML file, select the Gold Input From File checkbox.
    The AssertType and testFilePath fields are displayed.

  4. Map the activity variable from datasource section to activityTestInput field.
  5. Browse the gold input file from the project and select the gold input file. This modifies the testFilePath file in XML.
  6. Alternatively, 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/')
  7. 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 a 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 Plug-in 2.5.0 and above.
  8. To create a gold input file, run the activity for which you want to add the assertions. Copy the input job data from the debug console using the Copy Values option in an XML file.

  9. Change the input value with gold input values.
    Note: Linearize the copied XML data if required.