Application Server
WebSphere System Integration Testing with OpenSTA
Testing IFX Messaging Middleware with an Open Source Test Tool - Part One of a Two-Part Article
Oct. 6, 2005 01:00 PM
Digg This!
Page 2 of 2
« previous page
Note that the Script Modeler provides color-coding of Script Control Language keywords, commands, and comments. This feature came in handy while learning the commands and syntax of the Script Control Language. Also note that the test scripts are displayed in the left-hand frame of the OpenSTA user interface and managed using a directory-like structure that groups test cases into test case categories. This arrangement had to be set up outside of OpenSTA by using sub-directories in the OpenSTA directory "Scripts." The OpenSTA user interface didn't provide a way to create this hierarchy, but it could use it once it was deployed.
Listing 1 at the end of this article shows the contents of the test script shown in the Script Modeler graphic (Figure 3).
Based on the defined template, each test script followed the same execution pattern of OpenSTA commands and common subroutines (described in the section "Test Script Subroutines" in part 2 of this article, which will run in WebSphere Journal Vol: 4, Iss: 9). Referring to the line numbers shown in Listing 1, the script execution pattern is as follows:
- Lines 1 to 13 - initialization commands including the set of common variables provided by the file "IFX_VARIABLES.INC." The OpenSTA script compiler requires that Line 1 specify a target browser and browser version for the test even though this test doesn't involve any sort of browser whatsoever.
- Lines 14 to 18 - the commands to identify character strings that will be initialized by the IFX-encoded request and response messages specified in the File option. It took some trial and error for the test team to realize that even though the file name is specified in the command syntax, OpenSTA requires that the final extension of the file be ".fvr." Therefore, all of the IFX-encoded messages use the format test-script-name.xml.fvr for the message name. Another limitation of OpenSTA is that the File option has to be provided with a hard-coded value. If this could have been a variable value, then a single test script could have been written to completely parameterize test case execution.
- Lines 19 to 43 - the commands and sub-routine calls to read the IFX-encoded request and response messages issue an HTTP POST to send the message, receive the reply, and report the results to the test results file.
- Lines 44 to 58 - the commands and sub-routine calls to compare the actual IFX-encoded response to the model IFX-encoded response. If the comparison is successful, the test case is flagged as passed; otherwise, it's flagged as failed.
- Line 59 to 60 - the command to reference the common subroutines file "IFX_SUBROUTINES.INC" that provide the logic for the Read_Rq, Read_Model_Rs, Post_Request, REMOVE_CRLF, and CHECK_4A sub-routines. Unlike the conventions followed by some other languages, the OpenSTA Script Control Language requires that an Include command that references sub-routines be placed inline and not within the Definitions section of the script.
Part 2 of this article will appear in the September 2005 issue of WebSphere Journal Vol: 4, Iss: 9.
Resources
Page 2 of 2
« previous page
About Greg HerringerGreg Herringer is an IT Architect with 15 years of experience in customer relationship management and contact center technologies, with a focus on the financial services and public sector industries. His background cuts across the entire application development lifecycle.