Command Line Interface

You can execute Blitz from the command line by means of the following command:

java -DBLITZ_HOME=%BLITZ_HOME% -cp %BLITZ_HOME%\lib\blitz.jar;%BLITZ_HOME%\lib\log4j-1.2.12.jar;%CLASSPATH%  blitz.main.Blitz <arg1> <arg2> <arg3>

However, this is fairly long and difficult to remember, so several shell scripts have been provided to simplify the process.

NOTE: If you run this command with no arguments (i.e. <arg1>, <arg2>, and <arg3> are omitted), Blitz will display a usage screen to explain all of the options.

TOP

Execution Mode

The basic process for instantiating and executing a test is to invoke Blitz from the command line and provide, as its single argument, the name of the root-level test file. This is accomplished through the use of a batch script file.

TOP

Execute Test File

Blitz.bat executes the test (scenario, suite, or case) in the specified file, and produces a result summary file containing details of the outcomes of all the individual test cases encountered during execution. The usage for this script is:

    Blitz <test file>

where <test file> [REQUIRED] is the name of a file containing a testCase (".tst"), a testSuite (".ste"), or a testScenario (".sno"). The script will execute the test contained in the given file, and produce a detailed result with an extension of ".result" in the directory containing the test file.

Examples:

Blitz C:\MyTestDirectory\MyTest.tst – causes the execution of the test case in file MyTest.tst from directory C:\MyTestDirectory. On completion of the test, a result file with the name MyTest.tst.result is written to the same directory.

Blitz MySuite.ste – causes the execution of the test suite in file MySuite.ste to be executed from the "current" directory. All nested test cases and test suites are assumed to be in the same "current" directory, unless they explicitly override this default setting. On completion of the test suite, the accumulated results are detailed in a file with the name MySuite.ste.result (also in the "current" directory).

Notes:

  • If any validation, parsing, or execution error occurs, Blitz will terminate and display an appropriate exception message on the screen.
  • If the number of failures or errors exceeds the prescribed maximum (as specified in a test scenario), Blitz will terminate early with an appropriate message on the console.
  • If the keepBackups.outcome system property is set to "Yes", and a result file for the specified test already exists, the old result file will be backed up first.  The backup file will have a name like MyTest.tst.20030215.161503.330.result, where the embedded numbers are of the form "YYYYMMDD.HHMMSS.MMM" representing the file’s creation date and time to the nearest millisecond. This allows for preservation of all result files during multiple runs of the same test.  If the system property is set to "No", then any previously existing result file will be overwritten.

TOP

Planning Mode

In planning mode, batch script files are used to perform administrative tasks.  These scripts do not actually execute the specified test files; instead, they perform functions which provide a sanity check on the validity of test files.

TOP

Validate Test File

BlitzValidate.bat performs a quick evaluation of the specified file to verify that it is well-formed and valid XML that conforms to the Blitz schema. The usage for this script is:

    BlitzValidate <test file>

where <test file> [REQUIRED] is the name of a file containing a testCase (".tst"), a testSuite (".ste"), or a testScenario (".sno"). The script will create output on the console indicating whether the specified file is valid; if it is not valid, an appropriate exception message is displayed on the console to indicate the nature of the problem.

TOP

Certify Test File

BlitzCertify.bat performs an evaluation of the specified file to construct and display a fully-formed hierarchical test object, and to display a description of any problems that might exist within the test. The usage for this script is:

    BlitzCertify <test file>

where <test file> [REQUIRED] is the name of a file containing a testCase (".tst"), a testSuite (".ste"), or a testScenario (".sno"). The script will produce textual output describing the hierarchical test; if any error occurs, an appropriate exception message is displayed on the console to indicate the nature of the problem.

TOP

Trace Test File

BlitzTrace.bat parses and analyzes the test in the specified file to provide an overview of how the test will proceed when it is executed. This does not actually execute the test so it cannot predict the outcome of a test or determine the correctness of a test (although validity of the XML file is checked); its only purpose is to provide a detailed view of the environment and configuration under which a set of test cases will run. The report generated by this utility, produced as a text file with a ".trace" extension, can be used to verify that a scenario will do what was originally expected.

Usage for this script is:

BlitzTrace [<detailLevel>] <test file>

where <detailLevel> [OPTIONAL] specifies the amount of detail to be included in the file. Allowable values are as follows:

  • -terse | -t : minimum detail; only include test file names and concurrency/repeat details
  • -normal | -n : normal detail; include test file names, descriptions, and explicitly defined or inherited characteristics; exclude anything that is undefined
  • -verbose | -v : maximum detail; include test file names, descriptions, and all other characteristics, whether they are defined or not

and <test file> [REQUIRED] is the name of a file that contains a test scenario, a test suite, or a test case. Blitz analyzes the given file and produces an identically named file with an extension of ".trace", located in the same directory as the source file.

If the keepBackups.trace system property is set to "Yes", and a trace file already exists for the named test, the old trace file will be backed up first. The backup will have a name like MyTest.tst.20030215.161503.330.trace, where the embedded numbers are of the form "YYYYMMDD.HHMMSS.MMM" representing the file’s creation date and time to the nearest millisecond. If the system property is set to "No", then any previously existing trace file will be overwritten.

Example:

BlitzTrace –v C:\MyTestScenarios\MyTest.sno – causes Blitz to analyze the specified file and create a verbose trace file called C:\MyTestScenarios\MyTest.sno.trace.

TOP

Promote Actual Result

BlitzPromote.bat converts the actual result from a previous run of a test into an expected result for subsequent executions of the same test. The usage for this script is:

BlitzPromote <source> [<target>]

where <source> [REQUIRED] is the name of a particular file containing an actual result. If the last component of the pathname ends with ".act", the object is assumed to be a file, and the utility will attempt to convert only this file; otherwise, the object is treated as a directory, and the utility attempts to convert all files in that directory that end with the ".act" extension;

and <target> [OPTIONAL] is the name of a directory to which the corresponding ".exp" file should be written; if omitted, Blitz will store the result file(s) in same directory that contained the source file(s).

Examples:

BlitzPromote C:\Actual\ThisFile.act C:\Expected – causes the specific file "ThisFile.act" in the first named directory (C:\Actual) to be copied as "ThisFile.exp" into the second named directory (C:\Expected); any pre-existing file with the name "ThisFile.exp" is overwritten.

BlitzPromote C:\Actual C:\Expected – causes all ".act" files in the first named directory (C:\Actual) to be copied as ".exp" files in the second named directory (C:\Expected); any pre-existing ".exp" files may be overwritten.

BlitzPromote C:\MyTestArea – causes all ".act" files in the specified directory to be copied as ".exp" files in the same directory. Any existing ".exp" files may be overwritten.

TOP