Modify Settings in a Configuration

You can use the -batch mode option and its commands to temporarily modify the contents of a .jti file loaded in memory without changing the .jti file itself. This can be done when running tests, writing test reports, and auditing test results either from the command line or as a part of a product build process.

The commands used with -batch are a formatted set of commands, executed in the sequence that they appear in the command string. See Formatting a Batch Command for a description of the formats you can use.

Use the commands in the command string as you would if you were writing a script.

Selecting Tests to Run

You can use an existing .jti file and then set the specific tests to be run. You can specify one or more individual tests or branches of tests to be run

In the following examples, a test suite (mytestsuite.ts) and work directory (myworkdir.wd) and a .jti file (myconfig.jti) are opened, and the tests to be run are set before running tests. In the following example, tests in branches api/javax_swingand api/java_awt will be run.

The following text is a note
To run the following examples you must replace mytestsuite.ts, myworkdir.wd, and myconfig.jti with test suite, work directory, and .jti names that exist on your system. Win32 users must also change / file separators to \ file separators to run these examples.

Batch Options Example

java -jar lib/javatest.jar -batch -testsuite mytestsuite.ts -workdir myworkdir.wd -open myconfig.jti -tests api/javax_swing api/java_awt -runtests

Single String Arguments Example

java -jar lib/javatest.jar -batch "testsuite mytestsuite.ts workdir myworkdir.wd open myconfig.jti; tests api/javax_swing api/java_awt; runtests"

The path used for setting the test or folder of tests to be run is the same as that displayed in the tree folder. One or more tests can be specified.

Selecting an Exclude List

You can use an existing .jti file and then specify the exclude list to be used when running tests.

In the following examples, a test suite (mytestsuite.ts) and work directory (myworkdir.wd) and a .jti file (myconfig.jti) are opened, and the exclude list (myexcludelist.jtx is set before running tests.

The following text is a note
To run the following examples you must replace mytestsuite.ts, myworkdir.wd, myconfig.jti, and myexcludelist.jtx with test suite, work directory, .jti and .jtx names that exist on your system. Win32 users must also change / file separators to \ file separators to run these examples.

Batch Options Example

java -jar lib/javatest.jar -batch -testsuite mytestsuite.ts -workdir myworkdir.wd -open myconfig.jti -exclude myexcludelist.jtx -runtests

Single String Arguments Example

java -jar lib/javatest.jar -batch "testsuite mytestsuite.ts workdir myworkdir.wd open myconfig.jti; exclude myexcludelist.jtx; runtests"

Setting Configuration Values

You can use an existing .jti file and then specify the values to be used when running tests.

In the following examples, a test suite (mytestsuite.ts), work directory (myworkdir.wd), and a .jti file (myconfig.jti) are opened, then one or more name=values are specified for running tests.

The following text is a note
To run the following examples you must replace mytestsuite.ts, myworkdir.wd, and myconfig.jti with test suite, work directory, and .jti names that exist on your system. Win32 users must also change / file separators to \ file separators to run these examples.

To change a value on the command line it must be in your current interview path. If your current interview path does not include jckdate.gmtOffset you must either add it to the interview path or replace it with a value that is in the path. To view the current interview path, open your .jti file in the Configuration Editor. See Obtaining the Question tag-name.

Batch Options Example

java -jar lib/javatest.jar -batch -testsuite mytestsuite.ts -workdir myworkdir.wd -open myconfig.jti -set jckdate.gmtOffset=8 -runtests

Single String Arguments Example

java -jar lib/javatest.jar -batch "testsuite mytestsuite.ts workdir myworkdir.wd open myconfig.jti; set jckdate.gmtOffset=8; runtests"


Copyright © 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.