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:

  • None (blank field) - the test has not yet been run.
  • Passed - the test has been executed, and all expected output messages match their corresponding actual output messages.
  • Failed - the test has been executed, and at least one expected output message does not match its corresponding actual output message.
  • Executed - the test has been executed, but not validated. The test has run, with no fatal errors occurring.
  • Error - fatal errors have occurred while running the test.
  • Skipped - the test has been skipped, usually because no input messages have been selected when in testing in collection mode.

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:

  1. On the Mapping Project Manager, select the mapping project you want to test. The Mapping Project Editor for the mapping project is displayed.
  2. 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:

  1. On the Intelligent Mapping Testing dialog, the Select the Add Tests button to display the Import Test Messages dialog:

  2. Select the directories containing the input and output messages.
  3. Enter the source and target fields to match the messages on.
  4. Select the Pair Messages button.
  5. The analysis results are displayed in the Matched Messages panel:

  6. 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:

  1. On the  Intelligent Mapper Testing  dialog, select the  Add Test  button to display the Test Editor dialog:

  2. Enter a Name and Description for the test. 

  3. In the Input Messages tab, select the test mode for input message in Mode:
    1. 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.
    2. 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.
  4. In the  Expected Output Messages  tab,  select the expected output message mode:
    1. 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.
    2. 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.
  5. 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:

  1. Add message properties.
  2. 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.
  3. 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).
  4. 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.
  5. 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:

  1. Check the Validate expected output result checkbox if you want your test result to be validated.
  2. Check the Expect test result to be an error checkbox if you want your test to pass when there is an error.
  3. Add message properties.
  4. Enter the properties and message fields to ignore in the Ignore Paths field.
  5. 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.
  6. 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).
  7. 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.
  8. 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:

  1. Click the Select link to select a message definition (clicking the Clear link clears the message definition).
  2. Add message properties.
  3. 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.
  4. 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).
  5. 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.
  6. 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:

  1. Check the Expect test result to be an error checkbox if you want your test to pass when there is an error.
  2. Click the Select link to select a message definition (clicking the Clear link clears the message definition).
  3. Add message properties.
  4. Enter the properties and message fields to ignore in the Ignore Paths field.
  5. 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.
  6. 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).
  7. 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.
  8. Select the OK button to save your changes, or the Cancel button to abort.

Modifying a Mapping Project Test

To modify a test:

  1. 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:
  2. Edit the Name and Description for the test as required.

  3. To edit an input message, select the Input Messages tab:
    1. If in single message test mode, refer to Input Message - Single Message Test Mode on how to edit an input message.
    2. If in message collection test mode, refer to Input Messages - Message Collection Test Mode on how to edit one or more input messages.
  4. To edit an input message, select the Expected Output Messages tab:
    1. If in single message test mode, refer to Expected Output Message - Single Message Mode on how to edit an expected output message.
    2. If in message collection test mode, refer to Expected Output Messages - Message Collection Mode on how to edit one or more expected output messages.
  5. Select the OK button to add the test message, or the Cancel button to abort.

Deleting Mapping Project Tests

To delete tests:

  1. On the Intelligent Mapper Testing dialog, select the tests you want to delete by checking their checkbox, then select the Remove Test button.
  2. Select the Yes button when prompted to confirm the deletion.