The JavaTest harness provides a small web server that you can use to remotely monitor and control a test run. The HTTP Server provides two types of output:
The HTML formatted output is provided as human readable pages (these pages are subject to change in future releases of the JavaTest harness), allowing users to remotely monitor batch mode test runs in a web browser and stop any test runs that are not executing as expected:
java -jar
[jt_dir]/javatest.jar -startHttp -batch
[options]
Example:
JavaTest HTTPd - Success, active on port 1903
JavaTest HTTPd server available at http://129.145.162.75:1903/
Example:
http://129.145.162.75:1903/
The root of the web server provides an index page that only lists the handlers registered with the internal web server; not all available URLs on the server. You can also display the HTTP Server Index page by including /index.html
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/index.html
Each JavaTest harness has it's own handler, identified by a unique number as the second component of the URL.
When the JavaTest harness is running tests, the harness page displays:
In addition to the list of registered handlers, the page also prints the UTC/GMT date on which that page was generated (subject to the system clock on the machine which JavaTest is running) and provides the JavaTest version number and build date.
You can display the HTTP Server Harness page by choosing its link on the index page or by including /harness
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/harness
The Test Result Index page displays:
The total number of tests is also a link to view the current test results. The test results are displayed in a two column table, by test name and status message.
You can display the Test Result Index page by choosing its link on the harness page.
The Harness Environment page displays the environment information provided to the JavaTest harness and used in the current test run. The environment information is displayed in an HTML table and provides a view of the current settings.
You can display the Harness Environment page by choosing its link on the harness page or by including /harness/env
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/harness/env
The Harness Interview page displays the configuration interview provided to the JavaTest harness and used in the current test run.
You can display the Harness Interview page by choosing its link on the harness page or by including /harness/interview
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/harness/interview
If you want to remotely terminate a test run for any reason, you can use the HTTP server. Include /harness/stop
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/harness/stop
To stop the test run, you must click the STOP button on the page displayed in the browser.
The HTTP server provides plain text output that can be used for automated monitoring of the JavaTest harness during test runs. The plain text output does not include HTTP headings or HTML formatting and is intended for use by automated testing frameworks, not for viewing in web browsers. Consequently, future releases of the JavaTest harness will attempt to maintain the content formatting and URLs of this output.
Two types of JavaTest information can be accessed by automated testing frameworks:
The HTTP Server Version page displays version information about the JavaTest harness. You can display the HTTP Server Version page by choosing its link on the index page or by including /version
at the end of the URL in the browser URL field:
Example:
http://129.145.162.75:1903/version
A dump of the version information is provided.
Example:
JavaTest 3.0.3 Built on 06 Feb 2002
The following strings access specific information about the JavaTest harness:
/harness/text/config
Currently provides, in java.util.Properties format, the Test Suite name location and work directory of the current harness configuration values.
Example:
testsuite.path=/export/scratch/sampleJCK-compiler-13a
testsuite.name=J2SE Sample Compiler 1.3a TCK (JCK)
workdir=/export/scratch/wdsc13a
/harness/text/tests
Provides in java.util.Properties format the initial tests used for the current test run.
Example:
url0=api/java_lang
url1=api/java_util
/harness/text/stats
Provides, in java.util.Properties format, the current count of test results in the each state (pass, fail, error, not run). Whitespace is not present in the output:
Example:
Passed.=0
Failed.=151
Error.=54
Not_run.=1
For performance reasons, the Not_run number usually equals the concurrency setting in batch mode and matches the "not run" number shown in the GUI when in GUI mode (Current Configuration view filter).
harness/text/results
Provides alternating lines of test name, test status.
Example:
lang/FP/fpl005/fpl00506m1/fpl00506m1.html
Error. context undefined for hardware.xFP_ExponentRanges
lang/FP/fpl005/fpl00506m2/fpl00506m2.html
Error. context undefined for hardware.xFP_ExponentRanges
vm/classfmt/atr/atrnew003/atrnew00301m1/atrnew00301m1.html
Failed. unexpected exit code: exit code 1
vm/classfmt/atr/atrnew003/atrnew00302m1/atrnew00302m1.html
Failed. unexpected exit code: exit code 1
vm/classfmt/atr/atrnew003/atrnew00303m1/atrnew00303m1.html
Failed. unexpected exit code: exit code 1
/harness/text/state
Indicates whether JavaTest is currently running. It will return one of the following:
running=true
running=false
/harness/text/env
Provides, in java.util.Properties format, the current environment settings for the test run.
Example:
command.testExecute=com.sun.jck.lib.ExecJCKTestOtherJVMCmd /work/jdk1.3.1/bin/java
-classpath $testSuiteRootDir/classes -Djava.security.policy=$testSuiteRootDir/lib/jck.policy
$testExecuteClass $testExecuteArgs
context.nativeCodeSupported=true
description=bar
jniTestArgs=-loadLibraryAllowed
nativeCodeSupported=true
platform.expectOutOfMemory=true