Show TOC

Procedure documentationTesting a Message Mapping Locate this document in the navigation structure

 

You use this procedure to check whether a complete message mapping functions at runtime once you have described it. For this purpose, the mapping editor generates, compiles, and then executes Java source code for the message mapping.

Prerequisites

  • The defined message mapping must be complete. This means that each mandatory target field must be assigned to one or more source fields. Furthermore, there must not be any unassigned arguments when using functions.

  • To test mapping programs in ES Repository, users require the either of the roles SAP_XI_ADMINISTRATOR_J2EE, SAP_XI_CONTENT_ORGANIZER_J2EE, SAP_XI_CONFIGURATOR_J2EE or SAP_XI_DEVELOPER_J2EE.

Procedure

1. Generate XML
  1. Select Message Mapping object from the required software component version.

  2. From the context menu, select   Generate   XML File  

  3. You can apply values in the XML editor and save them along with created XML file.

2. Test Configuration

To execute a message mapping, you require a test configuration that is valid according to your description of the source structure.

Test configuration can be done in two ways:

  1. Choose the message mapping object right-click   Run As   Run ESR Message Mapping  .

    Note Note

    • This step executes the test configuration (if one exists).

    • Run Configurations dialog opens with Object Details prefilled, if there is no configuration existing for message mapping.

    End of the note.
  2. Choose the message mapping object, right-click   Run As   Run Configuration  .

    Note Note

    • This launches Run Configurations dialog, you can right-click on ESR Message Mapping and choose New to create new Test Configuration.

    • You can save the run configuration using Apply button, which keeps the run configuration saved on eclipse workspace and loads it when Run Configuration dialog is launched.

    • XML instances can be created from Message Mapping object by using   Generate   XML File  , which can be used in different test configurations.

    • Using the XML editor, you can manually edit elements, attributes and their values.

    End of the note.
3. Enter Parameters

The mapping runtime sets some constants that the mapping programs can use to evaluate header fields in the source message.

  1. Switch to “Parameters” tab for entering parameters values.

    Note Note

    Here you can see the list of Importing and Header Parameters.

    End of the note.
  2. Enter values for parameters and select values in case of “Adapter” type parameter.

Note Note

At design time, the mapping runtime constants are not available. For test purposes, however, you can set these constants on the Parameters tab page (located at the Test Configuration of the Parameters tab page). The various data records for test parameters are saved along with the test configuration in workspace.

End of the note.
4. Test

Once you have loaded, generated, or entered an XML instance, in the mapping editor you can save the instance. The test configurations are saved in eclipse workspace.

To test mapping using the XML instance, click Run button, which is available in Run Configurations dialog.

Note Note

All the traces are logged into the error login eclipse (Debug, Information, and Warning).

End of the note.

Result

If you are testing the message mapping for the first time or have modified it after the last test, the test execution compiles the generated Java source code. The result of the transformation is displayed in the test result editor. Any errors that occurred during compilation are shown in the dialog and logged into the eclipse error log.

On the document page of editor the result output XML is shown and in the parameters page the exporting parameters are shown along with their values (if any).