To test whether a business process interface has been developed correctly, you need to verify that business objects can be successfully exchanged and processed. This section describes how to:
Request business objects are those that you send from Test Connector when it is emulating a connector that is the source of the events that trigger an interface. Working with request business objects consists of creating a business object instance, populating it with data, and sending the request.
To create a new business object in Test Connector, do the following:
Once you have created or loaded a business object and specified values for its attributes, you have several ways to send the business object as a request to the integration broker.
When a source connector sends a request business object in asynchronous mode, it does not expect to get back a response business object. Once the request business object is dispatched, the source connector's role in the transaction is finished. The response business object is typically processed by the integration broker. The default mode for Test Connector is asynchronous.
To send a business object asynchronously, do the following:
If the broker specified in the connector definition is InterChange Server then the business object request is sent to the server for processing.
If the broker specified in the connector definition is one of the supported message brokers or WebSphere Application Server then the business object is placed on the queue specified in the RequestQueue standard property.
When a source connector sends a request business object synchronously, it expects to get back a response business object from the integration broker after any destination applications have processed the request. In synchronous mode, Test Connector puts the response business object on the queue specified by the source connector's Synchronous Request Queue property. The default mode for Test Connector is asynchronous.
If the broker specified in the connector definition is InterChange Server then the business object request is sent to the configured port of the collaboration object chosen for processing.
If the broker specified in the connector definition is one of the supported message brokers or WebSphere Application Server then the business object is placed on the queue specified in the SynchronousRequestQueue standard property.
In batch mode, Test Connector lets you specify the number of instances of a particular business object you want to send, as well as one attribute in the top-level object --a primary key attribute, for example--that you want set to a unique value for each instance. Test Connector copies the business object as many times as you have specified, incrementing the value of the single attribute you specified, and sends each business object. This option allows you to create a large number of business objects quickly and easily.
If the selected attribute is a key field that participates in dynamic cross-referencing as part of an identity relationship, then you must guarantee that the initial value and all those that follow it are unique. Otherwise, the cross-referencing logic will fail, causing the request business objects to fail.
To ensure that the values are unique, you can use Relationship Manager or execute SQL statements against the table for the relationship participant as follows.
To send business objects in batch mode, do the following:
The selected attribute should typically be an attribute that uniquely identifies the business object, such as a primary key.
Test Connector generates the number of business objects you specified, all identical with the exception of the one specified attribute, whose value is incremented for each instance.
If the broker specified in the connector definition is InterChange Server then the business object request is sent to the server for processing.
If the broker specified in the connector definition is one of the supported message brokers or WebSphere Application Server then the business object is placed on the queue specified in the RequestQueue standard property.
The following sections describe the various ways you can set the values of simple and compound attributes in a business object instance:
To provide a value for a simple attribute, click its cell in the Value column and enter a value.
To add an instance of a child business object, right-click the attribute that represents the child object and select Add Instance from the context menu.
A plus sign (+) is added next to the attribute that represents child business object to show that there is at least one child business object instance. If you expand the child object attribute, numbered entries are displayed for each instance. The individual instances also have plus signs (+) next to them, so you can expand them and set values for their attributes.
To add more child business object instances, right-click the attribute that represents the child object and select Add Instance from the context menu.
To remove an instance of a child business object, right-click the instance and select Remove Instance from the context menu.
To remove all instances of a child business object, right-click the attribute that represents the child business object and select Delete All Instances from the context menu.
You can set the verb of a child business object to test the effect that value has on the business process. This can be helpful when you are troubleshooting logic that involves the cross-referencing of child objects.
To set the verb of a child business object instance, right-click it and choose Set Verb from the context menu. When presented with the "Select Verb" prompt, selected the desired verb and click OK.
You can edit the attributes of a business object received by a destination connector before you send it as a response. The toolbar of the "Response BO" dialog that you use when doing so has several toolbar buttons that can be used to set the values of the business object. For more information, see Editing response business objects.
You can save a business object in Test Connector so that it can be used for later tests, shared with technical support (to help troubleshoot problems), or used as response data. You can save any business object, including ones that you have created and ones that appear as requests in the Test Connector window of a destination connector. By default, business objects are saved to a file with a business object extension (.bo).
It is recommended that you create a directory or directory structure specifically for test data files, with subdirectories dedicated to each interface or to each connector, as appropriate. This organization makes the necessary files are easy to locate and makes testing more efficient. Furthermore, it is recommended that you give the test data file for a business object the same name as the business object definition itself.
Do the following to save a business object instance that you have created as a request:
Do the following to save a business object instance that has been received by a destination instance of Test Connector and will be sent as a response:
To load a business object that has been saved to a file, do the following:
To delete a business object from Test Connector, select Edit > Delete Business Object from the menu bar.
When you send a business object as a request, the business object appears in the "BO Request List" pane of any Test Connector instances that are emulating destination connectors in the interface, provided that the transaction did not fail.
After you have accepted the request business object, you can edit it if necessary as described in Editing response business objects.
Response business objects are those that you send from Test Connector when it is emulating a connector that is the recipient of business object requests in an interface. Working with response business objects consists of editing the values in the business object instance and sending the response back to the broker.
When you receive a business object request in a destination instance of Test Connector, you commonly want to edit the values of the attributes. For instance, you will want to provide unique values for primary key attributes that participate in relationships, or you will want to modify the value of other attributes to test map or collaboration logic that responds differently depending on the exact values in the business object.
When it receives a request business object, Test Connector presents the Response Business Object window.
Do the following to set the values of business object attributes :
The ability to load saved data into a business object request is very useful in situations where you have to populate a response business object with data before sending it as a reply. Instead of manually typing a value for each attribute that requires response data, you can type the values once, save the business object (as described in "Saving a business object"), and then load the saved data on subsequent tests.
After you accept a request business object, edit the business object, if needed, and send it back as a reply.
Table 25 lists Test Connector's reply options and shows their
corresponding connector return codes for both C++ and Java connectors.
For more detailed information about C++ or Java Connector return codes, see
the Connector Development Guide for Java or C++.
Table 25. Test Connector reply types and connector return codes.
Test Connector reply type | C++ connector return code | Java connector return code |
---|---|---|
Success | BON_SUCCESS | SUCCESS |
Fail | BON_FAIL | FAIL |
Multiple Hits | BON_MULTIPLE_HITS | MULTIPLE_HITS |
Retrieve By Content Fail | BON_FAIL_RETRIEVE_BY_CONTENT | RETRIEVEBYCONTENT_FAILED |
Not Found | BON_BO_DOES_NOT_EXIST | BO_DOES_NOT_EXIST |
Value Duplicate | BON_VALDUPES | VALDUPES |
To reply to a request business object, do the following:
Test Connector can compare two business objects of the same type and display the attributes that differ in value. You can use this function to view changes to a business object at different points in the execution of a transaction (for instance, you could compare a business object that has been sent to the integration broker with the same business object after the integration broker has updated it). To compare two business objects, do the following:
Test Connector opens the "Compare Business Objects" window with a table that displays the attributes which have different values in the two business objects.