![]() |
![]() |
|
|
Testing Format Definitions
Once you have built a format definition, you can test it using the Format Tester feature of Format Builder. The Format Tester parses and reformats data as a validation test and generates sample binary or XML data. This sample data can be edited, searched, and debugged to produce the expected results. The Format Tester uses the XML Translator runtime engine to perform the test translation.
This section discusses the following topics:
Starting Format Tester
To start the tester:
Note: To run Format Tester, you must have a message format document open in Format Builder.
Note: The Tester works with the currently loaded message definition document.
Figure 3-1 Format Tester Dialog
Using the Format Tester Main Window
The following topics discuss the elements of the Format Tester main window and provide instructions for navigating and executing commands from the Format Tester main window.
The following topics explain how to use each of these features to help you accomplish your task.
Using the Menu Bar
The following menus are available in Format Tester. All Format Tester menus are expandable from your keyboard by pressing Alt + mnuemonic key. Some menu commands are also executable using Ctrl + letter accelerator keys.
Figure 3-2 Menu Bar
File Menu The following commands are available from the File menu. Table 3-1 File Menu Commands
Edit Menu The following commands are available from the Edit menu Table 3-2 Edit Menu Commands
Display Menu The following commands are available from the Display menu Table 3-3 Display Menu Commands
Generate Menu The following commands are available from the Generate menu. Table 3-4 Generate menu Commands
Translate Menu The following commands are available from the Translate menu. Table 3-5
Menu Command |
Description |
---|---|
Binary to XML |
Converts the contents of the binary window to XML. |
XML to Binary |
Converts the contents of the XML window to binary. |
Using the Shortcut Menus Instead of using the standard menus to find the command you need, use the right mouse button to click an item in the pop-up shortcut menu. The following commands are available from the Shortcut menus. Note: Some commands may be unavailable, depending on which display panel the mouse pointer is currently in. Table 3-6 Shortcut Menu Commands
Using the Binary Window The binary data display panel acts as hexadecimal editor, displaying data offsets, the hex value of individual bytes, and the corresponding text, which can be optionally displayed as ASCII/EBCDIC characters. The Binary window consists of the following three tabs used to select which mode to display the data:
The editor allows for editing of the hex byte or the 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 hexadecimal editor allows you to display your data offsets as Hexadecimal or Decimal.
To change your data offsets:
Using the Escaped Text Feature
To use the Escaped Text feature, select the Escaped Text tab from within the Binary window to view non-printable characters as escape sequences. The Escaped Text window displays non-printable characters as hex values. For example, the Escaped Text window does not show line breaks, but escapes the carriage returns.
Using the Text Feature
To use the Text feature, select the Text tab from within the Binary window to view all printable characters. For example, carriage returns are shown as line breaks. If you have non-printable characters, the Text window displays them as small squares.
Using the XML Window
The XML data panel displays XML data that has been converted or translated from the contents of the Binary panel, or XML that is to be converted to Binary. The contents of the XML panel can be cleared or edited to suit your needs. When XML is generated, the XML Formatting Options specified in the Format Builder options dialog box are used. Refer to Setting Format Builder Options for more information.
Using the Debug Window
The Debug window displays the actions that take place during the translation operation, any errors that are encountered, and field and group values 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.
When you open the Format Tester, only the Binary and XML windows are visible. To open the Debug window, choose Display—>Debug to toggle the Debug window on and off. The Debug window opens below the Binary and XML windows.
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 feature allows for full debug information to be captured to a file. See the Using the Debug Log topic for more information.
Note: Using the Debug window or Log File increases the time required to translate from XML to Binary.
Using the Resize Bars
Resize bars are located between the Binary, XML, and Debug windows and enable each window to be resized to suit your needs. Each resize bar can selected and dragged up and down, or left or right, as appropriate, to enlarge one of the windows and reduce the other.
Each resize bar also contains two directional buttons that can be clicked to enlarge or diminish any of the three windows.
Testing Format Definitions
Perform the following steps to test a message format definition.
Figure 3-3 Format Tester
Note: You can leave Format Tester open while you modify the Message Format from within Format Builder. Any changes to the message definition are automatically detected by Format Tester.
Debugging Format Definitions
The following topics discuss the various Format Tester features you can use to debug and correct your data.
Searching For Values
The Format Tester Find feature allows you to search for hex or text values in the binary data. Perform the following steps to perform a hex or text value search.
Figure 3-4 Find Dialog Box
Positioning to an Offset
The Format Tester GoTo feature allows you to move the cursor in the binary editor to a byte offset you specify.
To move to a specified offset:
Figure 3-5 Goto Dialog Box
Using the Debug Log
The Format Tester debug log feature allows you to save your debug information in a text file.
To use the Format Tester debug log, choose File—>Debug Log. You will be presented with a standard Save As dialog box from which you can select the destination directory and name for this log file. If you select an existing file, the new debug information will be appended onto the end of the existing file.
Format Tester saves debug logs to the currently selected directory or the last directory selected.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|