Skip Headers
JavaTest Harness Architect's Guide,
JavaTest Harness 4.4.1 for the Java Platform
E20663-02
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

7 Compiling Test Suites

Depending on how you design your test suite, you may be able to use the JavaTest harness to compile your tests when building your test suite. The instructions below describe how to compile tests if your test suite uses the Simple Interview and Standard Test Script (StdTestScript) as described in Chapter 12. To use the JavaTest harness to compile your tests you must:

System Properties

The following table describes the system properties used in compilation:

Table 7-1 System Properties Used in Compilation

System Property Description

SimpleInterviewParameters.mode

Specifies the operating mode used by this configuration. The valid values are:

certify

Executes test suite classes (assumes that tests are already compiled)

precompile

Compiles the tests

developer

Compiles the tests and runs them

command.compile.java

Specifies the command that the JavaTest harness uses to compile the tests.


These properties are set on the JavaTest command line using the -D option, usually when running the JavaTest harness in batch mode in a shell script or batch command (see the JavaTest online help for details about batch mode).

You can use the following command lines as templates for compiling the simple test suite you created in Chapter 4:

Windows:

java  -DSimpleInterviewParameters.mode=precompile 
      -Dcommand.compile.java='com.sun.javatest.lib.ProcessCommand 
javac -d $testSuiteRootDir\classes -classpath $testSuiteRootDir\classes
       $testSource -jar javatest.jar -batch -testsuite ts_dir 
      -workdir -overwrite work_dir -report report_dir

UNIX:

java  -DSimpleInterviewParameters.mode=precompile 
      -Dcommand.compile.java='com.sun.javatest.lib.ProcessCommand 
javac -d $testSuiteRootDir/classes -classpath $testSuiteRootDir/classes 
       $testSource -jar javatest.jar -batch -testsuite ts_dir 
      -workdir -overwrite work_dir -report report_dir

Note:

Line breaks are added here to improve readability; your command line should be a single line that contains no line breaks.

Table 7-2 describes the parts of the command:

Table 7-2 Compilation Command Components 

Component

Description

com.sun.javatest.lib.ProcessCommand

The library command used to run processes (in this case the Java compiler) on the same machine as the one the JavaTest harness is running. See for more information about this and other library commands.

$testSuiteRootDir

The JavaTest variable that represents the root directory of the test suite. This value is provided by the JavaTest harness when the command is executed. This value is taken from the path you specify to the -testsuite option.

$testSource

The JavaTest variable that represents the test source file to compile. This value is provided by the JavaTest harness.

-batch

Specifies that the JavaTest harness be executed in "batch" mode. When run in batch mode the JavaTest GUI is not started. See the JavaTest online help for more information.

-testsuite

The fully qualified path name of the top-level test suite directory.

-workdir -overwrite work_dir

Specifies the name of the work directory to use for the compilation. The -overwrite option causes the JavaTest harness to first delete (if it exists) and create the specified work directory. It's generally a good idea to create fresh results each time you recompile.

-report report_dir

Specifies the name of the directory where reports are to be written. It is best to specify report_dir as a simple file name (no "\" or "/" characters; this causes the reports to be written in work_dir\reports\report_dir.