< prev index next >

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

Print this page
rev 48445 : 8194869: [TESTBUG][aix, s390] Adapt tests to platforms.
Reviewed-by: mbaesken


  69    clean
  70    exit 0
  71  } #end of pass()
  72 
  73 #Clean up the test_ext directory (PLUGINDST_DIR) before leaving
  74 clean()
  75  {
  76  echo "Removing PLUGINDST_DIR ${PLUGINDST_DIR}"
  77  if [ -n "${PLUGINDST_DIR}" -a -d "${PLUGINDST_DIR}" ] ; then
  78  rm -rf "${PLUGINDST_DIR}"
  79  fi
  80  }
  81 
  82 # end of subroutines
  83 
  84 
  85 # The beginning of the script proper
  86 
  87 # Checking for proper OS
  88 OS=`uname -s`

  89 case "$OS" in
  90    SunOS | Linux | Darwin )












  91       FILESEP="/"
  92       PATHSEP=":"
  93       TMP=`cd /tmp; pwd -P`
  94       ;;
  95 
  96    Windows* )
  97       FILESEP="\\"
  98       PATHSEP=";"
  99       TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
 100       ;;
 101 
 102    CYGWIN* )
 103       FILESEP="/"
 104       PATHSEP=";"
 105       TMP="/tmp"
 106       ;;
 107 
 108    # catch all other OSs
 109    * )
 110       echo "Unrecognized system!  $OS"


 163 ###############  YOUR TEST CODE HERE!!!!!!!  #############
 164 
 165 #All files required for the test should be in the same directory with
 166 # this file.  If converting a standalone test to run with the harness,
 167 # as long as all files are in the same directory and it returns 0 for
 168 # pass, you should be able to cut and paste it into here and it will
 169 # run with the test harness.
 170 
 171 # This is an example of running something -- test
 172 # The stuff below catches the exit status of test then passes or fails
 173 # this shell test as appropriate ( 0 status is considered a pass here )
 174 
 175 echo
 176 echo ------ PREPARE TEST PLUGIN ---------
 177 
 178 # note that we can not use some subdirectory of the
 179 # scratch dir as the plugin dst dir because the test
 180 # app have file read permission for all subdirs of the
 181 # scratch dir
 182 
 183 PLUGINDST_DIR=$(mktemp -d ${TMP}/iio_test.XXXXXXXX)
 184 echo "Created PLUGINDST_DIR as ${PLUGINDST_DIR}"
 185 
 186 TEST_PLUGIN=dummy.jar
 187 
 188 # remove old service declaration
 189 if [ -d META-INF ] ; then
 190     rm -rf META-INF
 191 fi
 192 
 193 # generate the service declaration
 194 if [ ! -d META_INF ] ; then
 195      mkdir META-INF
 196      mkdir META-INF/services
 197 fi
 198 
 199 # add wrong record to the service configuration
 200 echo "BadReaderPluginSpi" >  META-INF/services/javax.imageio.spi.ImageReaderSpi
 201 
 202 echo "DummyReaderPluginSpi" >> META-INF/services/javax.imageio.spi.ImageReaderSpi
 203 




  69    clean
  70    exit 0
  71  } #end of pass()
  72 
  73 #Clean up the test_ext directory (PLUGINDST_DIR) before leaving
  74 clean()
  75  {
  76  echo "Removing PLUGINDST_DIR ${PLUGINDST_DIR}"
  77  if [ -n "${PLUGINDST_DIR}" -a -d "${PLUGINDST_DIR}" ] ; then
  78  rm -rf "${PLUGINDST_DIR}"
  79  fi
  80  }
  81 
  82 # end of subroutines
  83 
  84 
  85 # The beginning of the script proper
  86 
  87 # Checking for proper OS
  88 OS=`uname -s`
  89 MKTEMP="mktemp"
  90 case "$OS" in
  91    AIX )
  92       FILESEP="/"
  93       PATHSEP=":"
  94       TMP=`cd /tmp; pwd -P`
  95       if ! [ -e ${MKTEMP} ] ; then 
  96         MKTEMP="/opt/freeware/bin/mktemp"
  97       fi
  98       if ! [ -e ${MKTEMP} ] ; then 
  99         pass "Test skipped because no mktemp found on this machine"
 100       fi
 101       ;;
 102 
 103    Darwin | Linux | SunOS )
 104       FILESEP="/"
 105       PATHSEP=":"
 106       TMP=`cd /tmp; pwd -P`
 107       ;;
 108 
 109    Windows* )
 110       FILESEP="\\"
 111       PATHSEP=";"
 112       TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
 113       ;;
 114 
 115    CYGWIN* )
 116       FILESEP="/"
 117       PATHSEP=";"
 118       TMP="/tmp"
 119       ;;
 120 
 121    # catch all other OSs
 122    * )
 123       echo "Unrecognized system!  $OS"


 176 ###############  YOUR TEST CODE HERE!!!!!!!  #############
 177 
 178 #All files required for the test should be in the same directory with
 179 # this file.  If converting a standalone test to run with the harness,
 180 # as long as all files are in the same directory and it returns 0 for
 181 # pass, you should be able to cut and paste it into here and it will
 182 # run with the test harness.
 183 
 184 # This is an example of running something -- test
 185 # The stuff below catches the exit status of test then passes or fails
 186 # this shell test as appropriate ( 0 status is considered a pass here )
 187 
 188 echo
 189 echo ------ PREPARE TEST PLUGIN ---------
 190 
 191 # note that we can not use some subdirectory of the
 192 # scratch dir as the plugin dst dir because the test
 193 # app have file read permission for all subdirs of the
 194 # scratch dir
 195 
 196 PLUGINDST_DIR=$(${MKTEMP} -d ${TMP}/iio_test.XXXXXXXX)
 197 echo "Created PLUGINDST_DIR as ${PLUGINDST_DIR}"
 198 
 199 TEST_PLUGIN=dummy.jar
 200 
 201 # remove old service declaration
 202 if [ -d META-INF ] ; then
 203     rm -rf META-INF
 204 fi
 205 
 206 # generate the service declaration
 207 if [ ! -d META_INF ] ; then
 208      mkdir META-INF
 209      mkdir META-INF/services
 210 fi
 211 
 212 # add wrong record to the service configuration
 213 echo "BadReaderPluginSpi" >  META-INF/services/javax.imageio.spi.ImageReaderSpi
 214 
 215 echo "DummyReaderPluginSpi" >> META-INF/services/javax.imageio.spi.ImageReaderSpi
 216 


< prev index next >