![]() |
![]() |
|
|
Testing Format Definitions
Once you have built a format definition, you can test it using Format Tester. 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. Format Tester uses the data translation run-time engine to perform the test translation.
This section discusses the following topics:
Starting Format Tester
To start Format Tester:
Note: To run Format Tester, you must have a message format document open in Format Builder.
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 + mnemonic 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.
Edit Menu
The following commands are available from the Edit menu
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 Translate Menu Commands
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 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 navigation tree.
When you open the Format Tester, 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 feature allows for full debug information to be captured to a file. See Using the Debug Log 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
Format Tester saves debug logs to the currently selected directory or the last directory selected.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|