test/javax/imageio/metadata/IIOMetadataFormat/runMetadataFormatThreadTest.sh

Print this page




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


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