You can test your mapping project by adding individual tests manually, or importing a group of tests based on analyzing input and output sample messages through the Intelligent Mapper Testing dialog:
The Intelligent Mapper Testing dialog provides the following information:
Field | Description |
---|---|
Name | The user-defined name of the test. |
Description | The user-defined description of the test. |
Result | The cumulative test result for the test:
You can open the Intelligent Mapper Test Results dialog by clicking on the result. Refer to Reviewing Mapping Project Test Results for details. |
You can perform the following actions from the Intelligent Mapper Testing dialog:
Action | Description |
---|---|
Add Test | Enables you to add a new individual test. |
Edit Test | Enables you to edit a test. |
Remove Test | Enables you to delete selected tests. |
Add Tests | Enables you add tests automatically via the Import Test Messages dialog. |
Run Test | Enables you to run a test you have selected. |
Run Checked Tests | Enables you to run all tests you have checked. |
Select All | Selects all tests by checking their checkboxes. |
Deselect All | Deselects all tests by unchecking their checkboxes. |
Timeout | Enables you to set the maximum time in seconds allowed for running the tests. |
Logging Level | Enables you to set the level of logging events to capture. |
When you modify tests, the associated route is automatically checked out.
Viewing Mapping Project Tests
To view tests added to a mapping project:
- On the Mapping Project Manager, select the mapping project you want to test. The Mapping Project Editor for the mapping project is displayed.
- On the Mapping Project Editor, select the Manage Tests button to display the Intelligent Mapping Testing dialog.
If mapping project testing is not supported by your engine, or if you do not have the 'Run Intelligent Mapper tests' access right, then the Manage Tests button is disabled.
Adding Mapping Project Tests
You can add tests to a mapping project:
- Automatically, by performing a mapping analysis on source (input) and target (output) messages and importing the matched message pairs as test messages in individual tests. Refer to Importing Test Messages for details.
- Manually, by adding tests with matched message pairs as test messages. Refer to Adding Tests Manually for details.
Importing Test Messages
To add tests automatically to the mapping project by importing matched messages as individual tests:
On the Intelligent Mapping Testing dialog, the Select the Add Tests button to display the Import Test Messages dialog:
- Select the directories containing the input and output messages.
- Enter the source and target fields to match the messages on.
- Select the Pair Messages button.
The analysis results are displayed in the Matched Messages panel:
- Select the OK button to import the messages as individual tests, or the Cancel button to abort.
Adding Tests Manually
To add tests manually to the mapping project individually one at a time:
On the Intelligent Mapper Testing dialog, select the Add Test button to display the Test Editor dialog:
Enter a Name and Description for the test.
- In the Input Messages tab, select the test mode for input message in Mode:
- If you need to use a single input test message, select
Single Message
. Refer to Input Message - Single Message Test Mode on how to add a single input test message. - If you need to use multiple input test messages, select
Message Collection
. Refer to Input Messages - Message Collection Test Mode on how to add multiple input test messages.
- If you need to use a single input test message, select
- In the Expected Output Messages tab, select the expected output message mode:
- If you expect a single output message, select
Single Message
. Refer to Expected Output Message - Single Message Mode on how to add a single expected output message. - If you expect multiple output messages, select
Message Collection
. Refer to Expected Output Messages - Message Collection Mode on how to add multiple expected output messages.
- If you expect a single output message, select
- Select the OK button to add the test to the Intelligent Mapping Testing dialog, or the Cancel button to abort.
Alternatively, you can copy-paste an existing test to a filter from any mapping project or filter by using the right-click menu.
Input Messages - Single Message Test Mode
In single message test mode, the Input Messages tab appears as follows:
To add a single test message, enter the following information in the Input Messages tab:
- Add message properties.
- Select the Mode for your test message (you can switch between the two modes at any time):
Show Whitespace
mode uses Java escape characters to represent non-printable characters.Raw Hex
mode lets you directly edit the hexadecimal characters that make up the binary message.
- Select the Encoding for your test message (
Unknown/Not Set
means no encoding is stamped on the message when it is processed by the mapping code for testing). - Add your message using one of the following methods:
- Enter the message manually. Ensure you add
\r\n
(or\r
or\n
) to the end of every segment in the message. - Click the Load Message link to load a message from a file.
- Enter the message manually. Ensure you add
- Select the OK button to save your changes, or the Cancel button to abort.
Input Message - Message Collection Test Mode
In message collection test mode, the Input Messages tab appears as follows:
The Input Messages tab provides the following information for each input test message:
Field | Description |
---|---|
Name | The user-defined name for the test message. |
Definition | The message definition used by the test message. |
Description | The user-defined description of the test message. |
You can perform the following actions from the Input Messages tab:
Action | Description |
---|---|
Add | Enables you to add a test message using the Edit Input Message dialog. Alternatively, you can copy-paste an existing input test message from any mapping project or filter test in message collection test mode by using the right-click menu. |
Edit | Enables you to edit a selected test message using the Edit Input Message dialog. |
Remove | Enables you to delete a selected test message. |
Move Down | Enables you to prioritize the order in which the test messages are sent by demoting a selected test message. |
Move Up | Enables you to prioritize the order in which the test messages are sent by promoting a selected test message. |
Select All | Enables you to select all test messages. |
Deselect All | Enables you to deselect all test messages. |
Expected Output Messages - Single Message Mode
In single message test mode, the Expected Output Messages tab appears as follows:
To add a single test message, enter the following information in the Expected Output Messages tab:
- Check the Validate expected output result checkbox if you want your test result to be validated.
- Check the Expect test result to be an error checkbox if you want your test to pass when there is an error.
- Add message properties.
- Enter the properties and message fields to ignore in the Ignore Paths field.
- Select the Mode for your test message (you can switch between the two modes at any time):
Show Whitespace
mode uses Java escape characters to represent non-printable characters.Raw Hex
mode lets you directly edit the hexadecimal characters that make up the binary message.
- Select the Encoding for your test message (
Unknown/Not Set
means no encoding is stamped on the message when it is processed by the mapping code for testing). - Add your message using one of the following methods:
- Enter the message manually. Ensure you add
\r\n
(or\r
or\n
) to the end of every segment in the message. - Click the Load Message link to load a message from a file.
- Enter the message manually. Ensure you add
- Select the OK button to save your changes, or the Cancel button to abort.
Expected Output Messages - Message Collection Mode
In message collection test mode, the Expected Output Messages tab appears as follows:
The Expected Output Messages tab provides the following information for each input test message:
Field | Description |
---|---|
Name | The user-defined name for the test message. |
Definition | The message definition used by the test message. |
Description | The user-defined description of the test message. |
You can perform the following actions from the Expected Output Messages tab:
Action | Description |
---|---|
Add | Enables you to add a test message using the Edit Output Message dialog. |
Edit | Enables you to edit a selected test message using the Edit Output Message dialog. |
Remove | Enables you to delete a selected test message. |
Move Down | Enables you to prioritize the order in which the test messages are sent by demoting a selected test message. |
Move Up | Enables you to prioritize the order in which the test messages are sent by promoting a selected test message. |
Validate Expected Output Result |
Enables you to select whether your test results should be validated. |
Select All | Enables you to select all test messages. |
Deselect All | Enables you to deselect all test messages. |
Editing or Adding Input Messages
For input messages, the Edit Input Message dialog appears as follows:
To add an input test message, enter the following information in the Edit Messages dialog:
- Click the Select link to select a message definition (clicking the Clear link clears the message definition).
- Add message properties.
- Select the Mode for your test message (you can switch between the two modes at any time):
Show Whitespace
mode uses Java escape characters to represent non-printable characters.Raw Hex
mode lets you directly edit the hexadecimal characters that make up the binary message.
- Select the Encoding for your test message (
Unknown/Not Set
means no encoding is stamped on the message when it is processed by the mapping code for testing). - Add your message using one of the following methods:
- Enter the message manually. Ensure you add
\r\n
(or\r
or\n
) to the end of every segment in the message. - Click the Load Message link to load a message from a file.
- Enter the message manually. Ensure you add
- Select the OK button to save your changes, or the Cancel button to abort.
Editing or Adding Expected Output Messages
For expected output messages, the Edit Output Message dialog appears as follows:
To add an expected output message, enter the following information in the Expected Output Messages tab:
- Check the Expect test result to be an error checkbox if you want your test to pass when there is an error.
- Click the Select link to select a message definition (clicking the Clear link clears the message definition).
- Add message properties.
- Enter the properties and message fields to ignore in the Ignore Paths field.
- Select the Mode for your test message (you can switch between the two modes at any time):
Show Whitespace
mode uses Java escape characters to represent non-printable characters.Raw Hex
mode lets you directly edit the hexadecimal characters that make up the binary message.
- Select the Encoding for your test message (
Unknown/Not Set
means no encoding is stamped on the message when it is processed by the mapping code for testing). - Add your message using one of the following methods:
- Enter the message manually. Ensure you add
\r\n
(or\r
or\n
) to the end of every segment in the message. - Click the Load Message link to load a message from a file.
- Enter the message manually. Ensure you add
- Select the OK button to save your changes, or the Cancel button to abort.
Modifying a Mapping Project Test
To modify a test:
- On the Intelligent Mapper Testing dialog, double-click a test, or select a test, then click the Edit Test button to display the Test Editor dialog:
Edit the Name and Description for the test as required.
- To edit an input message, select the Input Messages tab:
- If in single message test mode, refer to Input Message - Single Message Test Mode on how to edit an input message.
- If in message collection test mode, refer to Input Messages - Message Collection Test Mode on how to edit one or more input messages.
- To edit an input message, select the Expected Output Messages tab:
- If in single message test mode, refer to Expected Output Message - Single Message Mode on how to edit an expected output message.
- If in message collection test mode, refer to Expected Output Messages - Message Collection Mode on how to edit one or more expected output messages.
- Select the OK button to add the test message, or the Cancel button to abort.
Deleting Mapping Project Tests
To delete tests:
- On the Intelligent Mapper Testing dialog, select the tests you want to delete by checking their checkbox, then select the Remove Test button.
- Select the Yes button when prompted to confirm the deletion.