Using Gold Input From File
Procedure
-
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.
- Select the Activity option.
- To provide the gold output through xml file, select the Gold Input From File check box.
- Map the activity variable from datasource section to activityTestInput field.
- 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/' )
-
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.
- 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.
-
Change the input value with gold input values.
Note: Linearize the copied xml data if required.
Copyright © 2020. TIBCO Software Inc. All Rights Reserved.