< prev index next >

test/javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh

Print this page

        

@@ -20,11 +20,11 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
 #   @test
 #
-#   @bug        6342404 7078379 8167503
+#   @bug        6342404 7078379 8167503 8183351
 #
 #   @summary    Test verifies that incorrectly configured ImageIO plugin spi
 #               does not affect registration of other ImageIO plugin in the
 #               applet context.
 #

@@ -55,21 +55,32 @@
 # usage: fail "reason why the test failed"
 fail()
  { echo "The test failed :-("
    echo "$*" 1>&2
    echo "exit status was $status"
+   clean
    exit $status
  } #end of fail()
 
 #Call this from anywhere to pass the test with a message
 # usage: pass "reason why the test passed if applicable"
 pass()
  { echo "The test passed!!!"
    echo "$*" 1>&2
+   clean
    exit 0
  } #end of pass()
 
+#Clean up the test_ext directory (PLUGINDST_DIR) before leaving
+clean()
+ {
+ echo "Removing PLUGINDST_DIR ${PLUGINDST_DIR}"
+ if [ -n "${PLUGINDST_DIR}" -a -d "${PLUGINDST_DIR}" ] ; then
+ rm -rf "${PLUGINDST_DIR}"
+ fi
+ }
+
 # end of subroutines
 
 
 # The beginning of the script proper
 

@@ -167,17 +178,14 @@
 # note that we can not use some subdirectory of the
 # scratch dir as the plugin dst dir because the test
 # app have file read permission for all subdirs of the
 # scratch dir
 
-PLUGINDST_DIR=${TMP}/test_ext
-#PLUGINDST_DIR=${TESTJAVA}/lib/ext
-TEST_PLUGIN=dummy.jar
+PLUGINDST_DIR=$(mktemp -d ${TMP}/iio_test.XXXXXXXX)
+echo "Created PLUGINDST_DIR as ${PLUGINDST_DIR}"
 
-if [ ! -d ${PLUGINDST_DIR} ] ; then
-    mkdir ${PLUGINDST_DIR}
-fi
+TEST_PLUGIN=dummy.jar
 
 # remove old service declaration
 if [ -d META-INF ] ; then
     rm -rf META-INF
 fi
< prev index next >