jtreg. Can I still write a regression
test?Yes. Most tests can be written using a series of main,
clean, build, applet, and
compile actions. However, there have been a few tests that need
to do things like run a specific application or access specific environment
variables. The shell action allows a user to invoke a Bourne
shell-script which can run arbitrary commands, including running
java and javac.
Warning! All tests, including shell-script tests, may be run on multiple platforms including Linux, Solaris, Windows NT, and Windows 95/98. The shell-script should be written to with this in mind. The following code fragment may be useful in defining various platform-dependent variables.
OS=`uname -s`
case "$OS" in
SunOS | Linux )
NULL=/dev/null
PATHSEP=":"
FILESEP="/"
TMP=/tmp
;;
Windows_* )
NULL=NUL
PATHSEP=";"
FILESEP="\\"
TMP=$TEMP
;;
* )
echo "Unrecognized system!"
exit 1;
;;
esac
If the shell action still does not provide the flexibility
needed to write the regression test, then use the ignore action.
It is also advisable to include a comment with sufficient detail to allow a
person to run the test and verify its behavior.