BEA Logo BEA WebLogic XML/Non-XML Translator 1.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic XML/Non-XML Translator Doc Home   |   BEA WebLogic XML/Non-XML Translator User Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Testing Format Definitions

 

Once you have built a format definition, you can test it using the built-in test feature of Format Builder. The test feature parses and reformats data as a validation test and also generates sample binary or XML data. Using the Tester, you can make sure the message formats you build with Format Builder produce the expected results. The Tester uses the runtime WLXT Java class to perform the test translation.

This section discusses the following topics:

 


Running the Tester

To run the tester:

  1. Start Format Builder.

    Note: To run the Tester, you must have a message format document open in the Format Builder.

  2. Choose Test-->Message Format. The Format Tester dialog displays.

    Note: The Tester works with the currently loaded message definition document.

    Figure 3-1 Format Tester Dialog

  3. Load a data file in the binary or XML edit control or enter your own data

    Field

    Description

    MFL Document

    Displays the name of the message format definition currently loaded in Format Builder.

    Binary

    Load

    Allows you to select the binary data file you want to work with.

    Save

    Allows you to save the binary data to a file.

    Generate

    Automatically generates binary test data based on the current message format definition.

    Clear

    Clears the data from the display area.

    Display Area

    Displays the results of loading or translating a file. You can also enter your own data or modify data you have entered.

    Note: Clicking the right mouse button in this display area opens a shortcut menu. From this menu, you can choose the Cut, Copy, or Paste commands. These commands allow you to cut or copy text displayed in this area and paste it in another location within this display area.

    Action Buttons

    To XML

    Translates the binary data in the currently loaded file to XML format, based on the current message format definition.

    To Binary

    Translates the XML data in the currently loaded file to binary format, based on the current message format definition.

    Debug

    Select this option if you want to display the actions the Tester performs during a translation.

    XML

    Load

    Allows you to select the XML data file you want to work with.

    Save

    Allows you to save the XML data to a different filename.

    Generate

    Automatically generates XML test data based on the current message format definition.

    Clear

    Clears the data from the display area.

    Display Area

    Displays the results of loading or translating a file. You can also enter your own data or modify data you have entered.

    Note: Clicking the right mouse button in this display area opens a shortcut menu. From this menu, you can choose the Cut, Copy, or Paste commands. These commands allow you to cut or copy text displayed in this area and paste it in another location within this display area.

    Debug

    Debug Display Area

    Displays the actions being performed by the Tester during a translation.

 


Debugging Formats

The following steps illustrate using the Tester to debug a message definition that does not translate correctly.

  1. Start Format Builder.

  2. Open a Message Format.

  3. Open the Tester dialog box and load the file (either XML or binary) that you want to translate.

  4. Select Debug. The Debug text box opens at the bottom of the Format Tester dialog.

  5. Click the appropriate button (to XML or to Binary) to translate your data. The Debug window displays the actions that take place during the translation operation, including any errors that are encountered. The field and group values will be displayed along with delimiters. To determine the location of the error, determine the last field that parsed successfully and examine the specification of the next field on the Tree Pane of Format Builder.

  6. Correct the errors and test the translation again.

  7. Continue this process until the translation is successful.

    Note: You can leave the Tester dialog box open while you modify the Message Format from within Format Builder. Any changes to the message definition are automatically used by the Tester.