182 fi 183 184 echo "Create Test.jar..." 185 if [ -f Test.jar ] ; then 186 rm -f Test.jar 187 fi 188 189 ${TESTJAVA}/bin/jar -cvf Test.jar -C ${TESTCLASSES} test 190 191 if [ $? -ne 0 ] ; then 192 fail "Failed to create Test.jar" 193 fi 194 195 # Prepare temp dir for cahce files 196 mkdir ./tmp 197 if [ $? -ne 0 ] ; then 198 fail "Unable to create temp directory." 199 fi 200 201 # Verify that all classloaders are destroyed 202 ${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main 203 if [ $? -ne 0 ] ; then 204 fail "Test FAILED: some classloaders weren't destroyed." 205 fi 206 207 208 # Verify that ImageIO shutdown hook works correcly 209 ${TESTJAVA}/bin/java -XaddExports:java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \ 210 -cp Test.jar -DforgetSomeStreams=true test.Main 211 if [ $? -ne 0 ] ; then 212 fail "Test FAILED: some classloaders weren't destroyed of shutdown hook failed." 213 fi 214 215 # sanity check: verify that all cache files were deleted 216 cache_files=`ls tmp` 217 218 if [ "x${cache_files}" != "x" ] ; then 219 echo "WARNING: some cache files was not deleted: ${cache_files}" 220 fi 221 222 echo "Test done." 223 224 status=$? 225 226 if [ $status -eq "0" ] ; then 227 pass "" 228 else 229 fail "Test failed due to test plugin was not found." | 182 fi 183 184 echo "Create Test.jar..." 185 if [ -f Test.jar ] ; then 186 rm -f Test.jar 187 fi 188 189 ${TESTJAVA}/bin/jar -cvf Test.jar -C ${TESTCLASSES} test 190 191 if [ $? -ne 0 ] ; then 192 fail "Failed to create Test.jar" 193 fi 194 195 # Prepare temp dir for cahce files 196 mkdir ./tmp 197 if [ $? -ne 0 ] ; then 198 fail "Unable to create temp directory." 199 fi 200 201 # Verify that all classloaders are destroyed 202 ${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} -cp Test.jar test.Main 203 if [ $? -ne 0 ] ; then 204 fail "Test FAILED: some classloaders weren't destroyed." 205 fi 206 207 208 # Verify that ImageIO shutdown hook works correcly 209 ${TESTJAVA}/bin/java --add-exports java.desktop/sun.awt=ALL-UNNAMED ${TESTVMOPTS} \ 210 -cp Test.jar -DforgetSomeStreams=true test.Main 211 if [ $? -ne 0 ] ; then 212 fail "Test FAILED: some classloaders weren't destroyed of shutdown hook failed." 213 fi 214 215 # sanity check: verify that all cache files were deleted 216 cache_files=`ls tmp` 217 218 if [ "x${cache_files}" != "x" ] ; then 219 echo "WARNING: some cache files was not deleted: ${cache_files}" 220 fi 221 222 echo "Test done." 223 224 status=$? 225 226 if [ $status -eq "0" ] ; then 227 pass "" 228 else 229 fail "Test failed due to test plugin was not found." |