IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Unit testing > Running unit tests in the test client
Testing business graphs
If an interface operation has a business graph as its parameter, you can use the integration test client to test the business graph in much the same way that you can test other operation parameters.
You can select specific business graph properties to manage as attributes in the value editor, which enables you to pass or return values for the business graph attributes. This test capability is especially useful for testing business graph implementations used by IBM adapters that connect to EIS systems.
Testing an interface operation that has a business graph as its parameter is similar in most respects to the more common practice of testing an interface operation that has a business object or a primitive type as its parameter. However, if you have not worked with the test client before, you should read the "Business graphs" section in the topic "Value and data pool editors", as well as the "Testing interface operations" topic and its subtopics, before testing business graphs.
To test a business graph:
Procedure
- Open the test client as described in the topic "Opening the integration test client."
- In the Configuration field, ensure that the correct test configuration is selected. A default test configuration is automatically created whenever you open the integration test client.
If you did not open the integration test client by loading a test configuration that you saved earlier, the default test configuration will already be selected in the Configuration field.
- In the Module field, ensure that the correct module is selected. If you opened the integration test client by selecting a module, this module will already be selected in the Module field.
- In the Component field, ensure that the component is selected that contains your interface operation.
- In the Interface field, ensure that the interface is selected that contains your operation.
- In the Operation field, select the operation that has a business graph as its parameter.
- If you want to specify a value for a verb business graph property in the value editor:
- In the Name column, locate the verb property.
- In the Value column, click the cell that appears in the same row as the verb property. A list is displayed.
- Select a value from the list. You can choose an enumeration that is defined in the underlying XSD file of the business graph, such as Create, Retrieve, Update, Delete, or UpdateWithDelete. In the following figure, the Update enumeration is selected.
- If you want to specify values for the changeSummary business graph property:
- In the Name column, right-click any of the cells and select Show Change Summary. A Change Summary column is appended to the value editor and the data pool editor, as shown in the following figure:
The Change Summary column accepts values that represent the original state of the business objects in the business graph. The Value column, by comparison, accepts values that represent the current state of the business objects in the business graph.
- If you want to log all changes that occur to the business objects after the operation is invoked, right-click any of the cells in the Name column and select Enable Logging. The changes will be recorded in the target adapter or component.
- In the Value column, specify values for the business graph, verb, business objects, or attributes as needed. Information about the specific values that you can specify in the Value column is found in the topic "Value and data pool editors."
- In the Change Summary column, specify values for the business objects or attributes as needed. If you are specifying a value for a business object, you can select the <create>, <update>, or <delete> predefined value. If you are specifying a value for an attribute, you can simply type a value. Information about the specific values that you can specify in the Change Summary column is found in the topic "Value and data pool editors."
- Click the Continue icon
. If the Deployment Location wizard opens, select the server where you want to deploy your selected module, as described in the test client topic "Deploying modules." From this point on, testing an operation that has a business graph as its parameter is similar to testing an operation that has a business object or primitive type as its parameter.
Example
Depending on how your component is implemented, you may only need to specify values for business object keys (unique identifiers) and not need to specify values for all of the associated attributes.For example, if you have selected <delete> for a business object in the Change Summary column, you will probably not want to specify values for any attributes other than the key because the business object has been deleted anyhow. Similarly, if you have selected <update> for a business object in the Change Summary column, you would only need to specify a value for the key and for those attributes that have actually been updated. And finally, if you have selected <create> for a business object in the Change Summary column, you would only need to specify a value for the key and for those attributes that are actually required rather than optional.