Powered By

Free XML Skins for Blogger

Powered by Blogger

Thursday, July 10, 2008

Test Environment for Interface Mappings in SAP XI

Use

To check whether an interface mapping that you have defined functions at runtime, test the interface mapping on the Test tab page. Note the following restrictions:

The Integration Builder cannot yet access the value-mapping table at the design stage. The results of accessing the value-mapping table are estimated as text output in the test results.

The runtime constants of the mapping runtime are not set, or are set to dummy constant values.

You can execute a test run to test the mapping for the request message, response message, or fault message.

Prerequisites

The mapping programs to be tested must be available in the Integration Repository.

Message mappings must be complete so that the generated Java source code can be compiled.

To test mapping programs in the Repository, users require the role SAP_XI_ADMINISTRATOR_J2EE, SAP_XI_CONTENT_ORGANIZER_J2EE, SAP_XI_CONFIGURATOR_J2EE, or SAP_XI_DEVELOPER_J2EE.

Features

The features of the test environment are the same as those of the test environment for message mappings, except for the management of test cases.

Test Instances

To execute a message mapping, you require a test instance in XML that is valid according to your description of the source structure (in XSD or XML). The mapping editor generates this test instance automatically when you switch to the Test tab page for the first time.

General Functions for Test Instances

Function

Use

This graphic is explained in the accompanying text (Load XML Instance)

Loads an XML instance from a local file.

This graphic is explained in the accompanying text (Pretty Print)

Formats the XML document (indents, line breaks).

You can edit the XML instances to use them in different test instances:

Using the editor for the text view. You can manually edit elements and attributes or their values here. Use CTRL C, CTRL X, and CTRL V respectively to copy, cut, and paste parts of an XML instance.

Using the context menu in the (Tabular) Tree View. You can copy subtrees, delete nodes, and add elements and attributes. In the tabular tree view, you can also enter values for fields in the Value column.

Trace Level

At runtime of a message mapping you can create messages for a trace in user-defined functions (see: MappingTrace Object). Furthermore, if you have set the trace level to Debug, the message mapping runtime writes information for error analysis to the trace. To display trace messages in the text window for status messages in the test environment, you must select a trace level before the test.

Trace Level

Output

No Trace

No information about the trace is displayed.

Warning

Trace messages are displayed that you have written to the trace by means of the addWarning() method.

Information

Trace messages are displayed that you have written to the trace by means of the addInfo() method.

Debug

Trace messages from the mapping runtime and so on are displayed that you have written to the trace by means of the addDebugMessage() method.

Activities

...

1. Navigate to the Test tab page.

On the Test tab page, the left side displays the Source XML Instance and the right side displays the result of the transformation, that is, the Target XML Instance. The display options correspond to those of the structure overview in the message mapping editor.

2. If there is more than one direction, select one from the Direction list box (Request, Response, or Fault). If there is more than one source message in the fault direction, select one from the Source Message list box.

3. Load or generate a source instance, or enter an instance in the mapping editor, and use the functions described above to enhance the instance further.

Note

If you have loaded an XML instance into the mapping editor, you use a copy of the instance and not the original when enhancing it in the mapping editor.

4. Select a trace level. To differentiate the trace outputs for mapping programs from those of the mapping runtime, use the outputs *** START APPLICATION TRACE *** and *** END APPLICATION TRACE ***.

5. To test your mapping using the XML instance, choose Execute Mapping (This graphic is explained in the accompanying text). If you are testing message mapping programs for the first time or have made changes since the last test, the Integration Builder compiles the generated Java source code before the test.

Result

The result of the transformation is displayed on the right-hand side. The Status Messages text frame displays the trace outputs and the transformation status, depending on the trace level. To delete all status messages, position the cursor within the text frame and from the context menu choose Delete Messages.

No comments:

Archives