Moving Test Reports

Because JavaTest reports contain links to files, you must update the links when moving reports to other directories. The JavaTest harness provides an EditLinks utility for you to use when moving reports.

Format of EditLinks Command

EditLinks reads one or more files or directories and copies them to a new file or directory. Files whose names end with ".html" are checked to see if they contain any HTML links that begin with certain filenames. Any that do are rewritten with a corresponding different filename. All other files are copied without change.

Example:
java -classpath lib/javatest.jar com.sun.javatest.EditLinks OPTIONS file...

OPTIONS
The various options are as follows:
-e oldPrefix newPrefix
Any links that begin with the string oldPrefix are rewritten to begin with newPrefix. Note that only the target of the link is rewritten, and not the presentation text. Thus the edit is effectively transparent when the file is viewed in a browser. Multiple -e options may be given; when editing a file, the options are checked in the order they are given.
For example, if the argument
-e /work/ /java/jck-dev/scratch/12Jun00/jck-lab3/
is used on a file that contains the following segment:
<a href="/work/api/java_lang/results.jtr">/work/api/java_lang/results.jtr</a>
the text shown bold below will match:
<a href="/work/api/java_lang/results.jtr">/work/api/java_lang/results.jtr</a>
and the resulting new file will contain the following:
<a href="/java/jck-dev/scratch/12Jun00/jck-lab3/api/java_lang/results.jtr">/work/api/java_lang/results.jtr</a>

-ignore file
When scanning directories, ignore any entries named file. Multiple -ignore may be given.

For example, '-ignore SCCS' will cause any directories named SCCS to be ignored.

-o file
The output file or directory. The output may only be a file if the input is a single file; otherwise, the output should be a directory into which the edited copies of the input files will be placed.

file...
The input files to be edited. If any of the specified files are directories, they will be recursively copied to the output directory, and any HTML files within them updated.

RETURN CODE
The program will exit with one of the following return codes:
0the copy was successful
1there was a problem with the command line arguments
2an error occurred while trying to perform the copy

Example of EditLinks Command

The following text is a note
To run the following example you must replace myworkdir.wd with a work directory name that exists on your system. Win32 users must also replace the "\" file separators with "/" to run these examples.

java -cp lib/javatest.jar com.sun.javatest.EditLinks -e /work/ /java/jck-dev/scratch/12Jun00/jck-lab3/ -o test12_dir.wd myworkdir.wd

A detailed description of the utility is also available in your TCK at:

doc/javatest/editlinks.html