155 if [ -n "$1" ] ; 156 then TESTJAVA=$1 157 else echo "no JDK specified on command line so using default!" 158 TESTJAVA=$DEFAULT_JDK 159 fi 160 TESTSRC=. 161 TESTCLASSES=. 162 STANDALONE=1; 163 fi 164 echo "JDK under test is: $TESTJAVA" 165 166 #Deal with .class files: 167 if [ -n "${STANDALONE}" ] ; 168 then 169 #if standalone, remind user to cd to dir. containing test before running it 170 echo "Just a reminder: cd to the dir containing this test when running it" 171 # then compile all .java files (if there are any) into .class files 172 if [ -a *.java ] ; 173 then echo "Reminder, this test should be in its own directory with all" 174 echo "supporting files it needs in the directory with it." 175 ${TESTJAVA}/bin/javac ./*.java ; 176 fi 177 # else in harness so copy all the class files from where jtreg put them 178 # over to the scratch directory this test is running in. 179 else cp ${TESTCLASSES}/*.class . ; 180 fi 181 182 #if in test harness, then copy the entire directory that the test is in over 183 # to the scratch directory. This catches any support files needed by the test. 184 185 #if [ -z "${STANDALONE}" ] ; 186 # then cp ${TESTSRC}/* . 187 #fi 188 189 #Just before executing anything, make sure it has executable permission! 190 chmod 777 ./* 191 192 ############### YOUR TEST CODE HERE!!!!!!! ############# 193 194 #All files required for the test should be in the same directory with 195 # this file. If converting a standalone test to run with the harness, 196 # as long as all files are in the same directory and it returns 0 for 197 # pass, you should be able to cut and paste it into here and it will 198 # run with the test harness. 199 200 # This is an example of running something -- test 201 # The stuff below catches the exit status of test then passes or fails 202 # this shell test as appropriate ( 0 status is considered a pass here ) 203 #./test # DELETE THIS LINE AND REPLACE WITH YOUR OWN COMMAND!!! 204 205 if [ -d ./test_classes ] ; then 206 rm -rf ./test_calsses 207 fi 208 209 mkdir ./test_classes 210 211 # split application classes and test plugin classes 212 mv ./UserPluginMetadataFormatTest*.class ./test_classes 213 214 $TESTJAVA/bin/java MetadataFormatTest test_classes UserPluginMetadataFormatTest 215 216 ############### END YOUR TEST CODE !!!!! ############ 217 status=$? 218 219 # pass or fail the test based on status of the command 220 if [ $status -eq "0" ]; 221 then pass "Test passed - no stack trace printing" 222 223 else fail "Test failure - stack trace was printed" 224 fi 225 226 #For additional examples of how to write platform independent KSH scripts, 227 # see the jtreg file itself. It is a KSH script for both Solaris and Win32 228 | 155 if [ -n "$1" ] ; 156 then TESTJAVA=$1 157 else echo "no JDK specified on command line so using default!" 158 TESTJAVA=$DEFAULT_JDK 159 fi 160 TESTSRC=. 161 TESTCLASSES=. 162 STANDALONE=1; 163 fi 164 echo "JDK under test is: $TESTJAVA" 165 166 #Deal with .class files: 167 if [ -n "${STANDALONE}" ] ; 168 then 169 #if standalone, remind user to cd to dir. containing test before running it 170 echo "Just a reminder: cd to the dir containing this test when running it" 171 # then compile all .java files (if there are any) into .class files 172 if [ -a *.java ] ; 173 then echo "Reminder, this test should be in its own directory with all" 174 echo "supporting files it needs in the directory with it." 175 ${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} ./*.java ; 176 fi 177 # else in harness so copy all the class files from where jtreg put them 178 # over to the scratch directory this test is running in. 179 else cp ${TESTCLASSES}/*.class . ; 180 fi 181 182 #if in test harness, then copy the entire directory that the test is in over 183 # to the scratch directory. This catches any support files needed by the test. 184 185 #if [ -z "${STANDALONE}" ] ; 186 # then cp ${TESTSRC}/* . 187 #fi 188 189 #Just before executing anything, make sure it has executable permission! 190 chmod 777 ./* 191 192 ############### YOUR TEST CODE HERE!!!!!!! ############# 193 194 #All files required for the test should be in the same directory with 195 # this file. If converting a standalone test to run with the harness, 196 # as long as all files are in the same directory and it returns 0 for 197 # pass, you should be able to cut and paste it into here and it will 198 # run with the test harness. 199 200 # This is an example of running something -- test 201 # The stuff below catches the exit status of test then passes or fails 202 # this shell test as appropriate ( 0 status is considered a pass here ) 203 #./test # DELETE THIS LINE AND REPLACE WITH YOUR OWN COMMAND!!! 204 205 if [ -d ./test_classes ] ; then 206 rm -rf ./test_calsses 207 fi 208 209 mkdir ./test_classes 210 211 # split application classes and test plugin classes 212 mv ./UserPluginMetadataFormatTest*.class ./test_classes 213 214 $TESTJAVA/bin/java ${TESTVMOPTS} ${TESTJAVAOPTS} MetadataFormatTest test_classes UserPluginMetadataFormatTest 215 216 ############### END YOUR TEST CODE !!!!! ############ 217 status=$? 218 219 # pass or fail the test based on status of the command 220 if [ $status -eq "0" ]; 221 then pass "Test passed - no stack trace printing" 222 223 else fail "Test failure - stack trace was printed" 224 fi 225 226 #For additional examples of how to write platform independent KSH scripts, 227 # see the jtreg file itself. It is a KSH script for both Solaris and Win32 228 |