|
|||||||||||
|
Appendix E
Running a Single Test From Command LineThe JCK tests can be run from command line, which can be helpful for debugging purposes. The JCK-runtime, JCK-compiler, and JCK-devtools test suites include sample UNIX shell scripts that show you how the tests are executed. To install shell scripts along with JCK, specify -install shell_scripts option during the installation. After the installation, the scripts are located in the test source directories - one script per test description. The purpose of the sample scripts is to show what information is required to run a test in a debugger or from a command line:
All configuration information is stored in the .html files in TestDescription tables. JavaTest Harness reads TestDescription and runs the test accordingly. When a test requires a configuration parameter, JavaTest takes its value from interview answers. Provided scripts show how the JavaTest Harness runs the test. For most configuration parameters, the typical value that suits most configurations is used. For other parameters, like network configuration where values can vary from system to system, the values must be set prior to script execution. E.1 Running ScriptsScripts can be run with a shell interpreter that is compatible with UNIX Korn shell. Scripts can be also run on a Windows system with MKS toolkit. In examples below 'sh' is used as shell interpreter. On some platforms 'ksh' should be used instead. Note that you need to set JAVA_HOME environment variable pointing to Java Implementation under test prior to script execution. Example E-1 Setting JAVA_HOME variable# export JAVA_HOME=/opt/java6 Example E-2 Running scripts from a Command Line# sh tests/api/java_lang/Package/index_Package.ksh or # cd tests/api/java_lang/Package # sh index_Package.ksh Example E-3 Running scripts located outside the JCK directoryWhen script modification is required, the script file can be copied to another location, modified and run from there. To run a script located outside of the JCK install directory, set the TCK_HOME environment variable to point to JCK location. # cp /jck/JCK-runtime-6b/tests/api/java_lang/Package/index_Package.ksh /tmp # export TCK_HOME=/jck/JCK-runtime-6b # sh /tmp/index_Package.ksh Example E-4 Running scripts that use default working directorySome tests create temporary files in the work directory. /tmp/jck-workdir is used as the default work directory. The directory is created automatically and after script execution, contains files created by tests. # sh tests/api/java_io/FileWriter/index_FWFlushTest.ksh /tmp/jck-workdir is created Example E-5 Running scripts with specified working directoryWork directory can be defined by setting TESTWORKDIR variable. # export TESTWORKDIR=/tmp/FileWriter # sh tests/api/java_io/FileWriter/index_FWFlushTest.ksh /tmp/FileWriter is created Example E-6 Running scripts with configuration parametersThere are scripts that require extra configuration parameters. These parameters should be set in the environment variables. # export NETWORK_LOCALHOST=myhost/123.10.11.12 # export NETWORK_TESTHOST1=neighbour.domain/10.11.12.13 # sh tests/api/java_net/InetAddress/index_ToString.ksh E.1.1 Hints for Running Scripts on a Windows SystemNote - Make sure MKS toolkit is installed before running the scripts.
|
|||||||||||
|
|||||||||||

Previous

