This section provides extended examples of command-line operations.
To use the following examples on your system, you must use classpaths and directory names appropriate for your system.
java -jar lib/javatest.jar -verbose -testSuite /tmp/
myts \
-workdir -create /tmp/
myworkdir -config /tmp/
my.jti \
-runtests -writereport /tmp/report
This combination of commands does the following, in this order:
/tmp/
myts.
/tmp/
myworkdir.
.jti
as the configuration settings.
/tmp/report/
after test execution.
java -jar lib/javatest.jar -startHttp -testsuite /tmp/
myts \
-workdirectory /tmp/
myworkdir -config /tmp/
my.jti \
-runtests -writereport /tmp/report -set
foo.bar 4096 \
-runtests -writereport /tmp/
report1
This combination of commands does the following, in this order:
/tmp/
myts.
/tmp/
myworkdir.
.jti
as the configuration settings.
/tmp/report/
after test execution.
/tmp/
report1.
java -cp lib/javatest.jar:lib/comm.jar \
com.sun.javatest.tool.Main \
-Especial.value=lib/special.txt \
-agentPoolPort 1944 -startAgentPool "testsuite /tmp/
myts ; \
workdir /tmp/
myworkdir ; config
myconfig.jti ; runtests"
This combination mixes two styles of command line arguments (quoted and
dash-style). It invokes the harness by class name, rather than executing the Java Archive
(JAR) file (-jar
). An extra item is added to the VM's classpath. The following commands are given to the harness:
/tmp/
myts.
/tmp/
myworkdir.
.jti
.
java -jar lib/javatest.jar -config
foo.jti -runtests
This command example relies on information in the JTI file to perform the run. Specifically, it tries to use the work directory and test suite locations specified in the JTI file. If either of those are invalid or missing, the harness reports an error. Otherwise, if the configuration in the JTI is complete, the tests are run.
java -jar lib/javatest.jar -config
foo.jti -verbose \
-set test.val1 2007 -runtests
This is the same as Example 4 with the exception that it turns on verbose mode and changes the answer of one of the questions in the configuration.
java -jar lib/javatest.jar -config
foo.jti \
-priorStatus fail,error -timeoutFactor 0.1 \
-set test.needColor Yes \
-set test.color1 orange -tests api/java_util -runtests
This example extends Example 4 by setting various Standard Values and the answer to particular configuration questions.
java -jar lib/javatest.jar -testsuite /tmp/
foo.jti
myts \
-workdirectory /tmp/
mywd -config /tmp/
myconfig.jti
This example stars the GUI. This combination of commands does the following, in this order:
Copyright © 2004, 2009, Oracle and/or its affiliates. All rights reserved.