You can test a map's transformation steps by providing sample data for the source business object and executing a test run of the map. A test run is map execution that does not involve an event sent by a connector or a call sent by an access client; the map executes within Map Designer Express. Map Designer Express provides a separate tab, the Test tab in the Map Designer Express window to test maps and view test results.
This section describes how to set up and execute a test run, using these steps:
Before running the test, perform the following steps:
Every time you test a map, you must load data into the source business object. To do this, use the Source Testing Data pane in the Test tab (see Figure 36). The Source Testing Data pane allows you to specify the following test information:
When you test the map for the first time, you must manually enter the values of the attributes in the Source Testing Data pane.
The following sections provide information about how to enter this data:
To create source business object data for the first time, follow these rules:
To save the values you have entered for future test runs, create a business object ( .bo) file by selecting the source business object and performing either of the following actions:
Result: The next time you test this map, you can click the Load From button and the attributes will be filled in automatically from the business object file.
Figure 36. Source Testing Data pane of the Test tab
If the source business object has child business objects and you want to specify test data for the child attributes, you must first create an instance for each child object you need. To do so, perform the following steps:
Guideline: The first instance you add has an index number of zero. You can have as many instances as you want (as long as the child attribute has multiple-cardinality).
Result: When you expand the object, you see the child attributes for this instance.
To add a child business object to the end of the array, right-click the last index and select Add Instance from the Context menu.
For subsequent test runs, Map Designer Express reuses the previously specified test data. You can take any of the following actions on this data:
To load attribute values from a business object file, select the source business object and perform either of the following actions:
When prompted, enter the name of the business object file to be loaded.
When you set a breakpoint, map execution pauses just before the transformation of the destination attribute on which the breakpoint is set. The use of breakpoints lets you step through map execution and check the sequence and the results of individual operations. You can set as many breakpoints as you like.
Guideline: Breakpoints are not part of the map's definition. You set breakpoints on the map after the map is opened in Map Designer Express, and when the map is debugged (either with Debug-->Run Test... or Debug-->Advanced-->Attach...). Breakpoints have no effect on the map when the map is not debugged from Map Designer Express.
To set a breakpoint, you can use any one of the following methods:
Result: Map Designer Express displays a dark circle next
to the destination attribute on which the breakpoint is set, as shown in Figure 37.
Once you set the breakpoint, the execution of the map instance pauses at this breakpoint and you can see the current status of the map. Unless you specify at least one breakpoint, the map executes and finishes with the message:
Test run finished
Rule: You must always provide values for the source data associated with the destination attributes where you set the breakpoints. Otherwise, the transformation rule will run normally and the breakpoints will execute normally, but the destination value will usually be empty, depending on what transformation rule is defined. For more information, see "Creating test data".
To view all breakpoints for the map, select Breakpoints from the Debug menu.
Result: Map Designer Express displays the Breakpoints
dialog (see Figure 38).
Figure 38. Breakpoints dialog of the test tab
From the Breakpoints dialog, you can perform any of the following actions:
Tip: To locate a particular breakpoint, enter its name in the Find field. The up and down arrows scroll through the business object list. In the Destination Testing Data pane, Map Designer Express highlights the destination attribute.
You can also remove a breakpoint by performing any of the following actions:
You can also clear all breakpoints by performing any of the following actions:
Once you have entered the source test data and set any desired breakpoints, you are ready to test the map. To run a map test involves the following steps:
To start the test run, perform the following steps:
Result: The Connect to IBM WebSphere InterChange Server Express dialog box will display and allow you to connect to the server for testing.
Guideline: Deploying a minimum set of business objects to the server for testing will minimize debugging initialization time.
Result: Execution of the map starts. Map Designer Express displays the following message in the output window:
Starting test run...
Map execution pauses when it reaches a destination attribute where you have set a breakpoint. When the breakpoint is reached, Map Designer Express takes the following actions:
Test Run stopped at attribute AttrName (next transformation--> "Rule").
Tip: With map execution paused, you can examine the values of the destination attributes that have been processed so far by looking in the Value column of the Destination Testing Data pane.
To continue map execution, perform any of the following actions:
To continue map execution for only one more step, perform any of the following actions:
Result: When the execution of the test run is finished without any run-time errors, Map Designer Express displays the following message in the output window:
Test run finished.
Test run results display in the destination business object, which is in the Destination Testing Data pane. Values resulting from the map transformations are visible in the Values column of this table. You can view test run results by either:
During a test run that has test data and breakpoints, you can watch as the destination business object fills with values. Values appear in the Values column in the Destination Testing Data pane as they are processed. When map execution is paused on a breakpoint, all destination attributes before that attribute in the execution order have values displayed.
To view the transformations as they occur:
To view test run results when the map has already executed, examine the destination business object in the Destination Testing Data pane.
To save the test results:
Result: Map Designer Express saves the values of the destination attributes in a business object ( .bo) file.
As you test the map, you might discover the need to change the map. To edit the map and then continue the test, perform the following steps:
Important: