bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > WebLogic Platform > WebLogic Integration > DI Topics > Translating Data > Testing Format Definitions |
Translating Data
|
Testing Format Definitions
After you build a format definition, you can test it using the Format Tester. The Format Tester parses and reformats data as a validation test and then generates sample binary or XML data. This sample data can be edited, searched, and debugged to produce the expected results. Format Tester uses the data translation run-time engine to perform the test translation.
This section discusses the following topics:
Starting the Format Tester
To start Format Tester:
Figure 2-1 Format Tester Dialog Box
The Format Tester dialog box is divided into three windows: the Binary window, the XML window, and the Debug window. Resize bars divide the windows. You can drag the resize bar to adjust window size, or click an arrow on the bar to show or hide a window. For example, you can click the left arrow on the bar dividing the Binary and XML windows to hide the Binary window. If a window is hidden, you can drag the bar or click the appropriate arrow to restore the window.
Note: When you open the Format Tester for the first time in a session, only the Binary and XML windows are visible. To open the Debug window, use the resize bar at the bottom of the Format Test dialog box, or choose Display
Using the Format Tester Dialog Box
The following topics explain how to use various tools provided in the Format Tester dialog box to navigate and execute commands:
The following topics explain how to use each of these features to help you accomplish your task.
Using the Binary Window
The Binary window can contain sample data that has been:
You can open an existing binary data file, edit or save the contents of the window, or clear the window as required for your test situation. For details, see Using the Menu Bar and Using the Shortcut Menus.
The Binary window of the Format Tester dialog box serves as a binary file editor. The window contains the following tabs:
The editor allows you to edit a hex byte or a text value. If a hex data value is modified, the corresponding text value is updated, and vice versa.
Using the Data Offset Feature
The data offset feature of the Hex tab allows you to display the data offsets as hexadecimal or decimal addresses.
To change the format of the data offsets:
Using the Text Feature
The Text tab of the Binary window displays the printable characters (usually in the form of words and numbers) and certain control characters (carriage return, tab, and so on). For example, carriage returns are shown as line breaks. Non-printable characters, are displayed as small squares.
Using the XML Window
The XML window can contain sample XML that has been:
You can open an existing XML file, edit or save the contents of the window, or clear the window as required for your test situation. For details, see Using the Menu Bar and Using the Shortcut Menus.
When XML is generated, the XML Formatting Options specified in the Format Builder options dialog box are used. For additional information, see Setting Format Builder Options.
Using the Debug Window
The Debug window displays the actions that occur during a translation operation, any errors that are encountered, and field and group values, along with delimiters. To determine the cause of an error, identify the last field that parsed successfully and examine the properties of the field listed after it in the navigation tree.
When you open the Format Tester for the first time in a session, only the Binary and XML windows are visible. To open the Debug window, choose Display
Debug output is restricted to the most recent 64 KB of messages. This restriction prevents large debug output from causing a JVM out of memory event.
The debug log feature allows you to save all debugging information in a file. For details, see Using the Debug Log.
Note: Use of the Debug window or log file increases the time required to translate from XML to Binary.
Using the Resize Bars
You can change the dimensions of any window in the Format Tester by using the resize bars located between the Binary, XML, and Debug windows. To change the size of a window, select a resize bar and drag in the appropriate direction (up or down or to the left or right) to enlarge one of the windows and reduce the other.
Each resize bar also contains two directional buttons. Click the appropriate button to show or hide any of the three windows.
Using the Menu Bar
Format Tester functions can be accessed from the five menus listed in the menu bar at the top of the main window.
Figure 2-2 Menu Bar
You can expand a Format Tester menu in either of two ways:
To execute a command, select it from the menu. Some commands can also be executed via the keyboard shortcut indicated on the menu (For example, a Ctrl + key sequence.) The commands available on each menu are described in the following sections.
File Menu
The following commands are available from the File menu.
Edit Menu The following commands are available from the Edit menu.
Display Menu The following commands are available from the Display menu.
Generate Menu The following commands are available from the Generate menu.
Translate Menu The following commands are available from the Translate menu.
Using the Shortcut Menus When you right-click in the Binary, XML, or Debug window, a menu of the most frequently used commands for that window is displayed. The following table describes the commands that are available from the shortcut menus.
Testing Format Definitions
To test a message format definition:
Figure 2-3 Format Tester
Note: You can leave Format Tester open while you modify the message format document in Format Builder. Changes to the document are detected automatically by Format Tester.
Debugging Format Definitions
The following topics explain how to use three Format Tester features to debug and correct your data:
Searching for Values
The Find command allows you to search for hex or text values in the binary data.
To search for a hex or text value:
Figure 2-4 Find Dialog Box
Positioning to an Offset
The Go To command allows you to move the cursor to a specified hexidecimal or decimal address (offset).
To move to a specified offset:
Figure 2-5 Go To Dialog Box
Using the Debug Log
Although debugging information is not saved by default, the Format Tester dialog box allows you to specify a debug log file. When you specify a debug log file, all debugging information generated during your testing session is appended to the specified file.
To specify a debug log file:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |