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
96 type ${MKTEMP} > /dev/null 2>&1
97
98 if ! [ $? -ne 0 ] ; then
99 MKTEMP="/opt/freeware/bin/mktemp"
100 fi
101 if ! [ -e ${MKTEMP} ] ; then
102 pass "Test skipped because no mktemp found on this machine"
103 fi
104 ;;
105
106 Darwin | Linux | SunOS )
107 FILESEP="/"
108 PATHSEP=":"
109 TMP=`cd /tmp; pwd -P`
110 ;;
111
112 Windows* )
113 FILESEP="\\"
114 PATHSEP=";"
115 TMP=`cd "${SystemRoot}/Temp"; echo ${PWD}`
116 ;;
117
118 CYGWIN* )
119 FILESEP="/"
120 PATHSEP=";"
121 TMP="/tmp"
122 ;;
123
124 # catch all other OSs
125 * )
126 echo "Unrecognized system! $OS"
179 ############### YOUR TEST CODE HERE!!!!!!! #############
180
181 #All files required for the test should be in the same directory with
182 # this file. If converting a standalone test to run with the harness,
183 # as long as all files are in the same directory and it returns 0 for
184 # pass, you should be able to cut and paste it into here and it will
185 # run with the test harness.
186
187 # This is an example of running something -- test
188 # The stuff below catches the exit status of test then passes or fails
189 # this shell test as appropriate ( 0 status is considered a pass here )
190
191 echo
192 echo ------ PREPARE TEST PLUGIN ---------
193
194 # note that we can not use some subdirectory of the
195 # scratch dir as the plugin dst dir because the test
196 # app have file read permission for all subdirs of the
197 # scratch dir
198
199 PLUGINDST_DIR=$(${MKTEMP} -d ${TMP}/iio_test.XXXXXXXX)
200 echo "Created PLUGINDST_DIR as ${PLUGINDST_DIR}"
201
202 TEST_PLUGIN=dummy.jar
203
204 # remove old service declaration
205 if [ -d META-INF ] ; then
206 rm -rf META-INF
207 fi
208
209 # generate the service declaration
210 if [ ! -d META_INF ] ; then
211 mkdir META-INF
212 mkdir META-INF/services
213 fi
214
215 # add wrong record to the service configuration
216 echo "BadReaderPluginSpi" > META-INF/services/javax.imageio.spi.ImageReaderSpi
217
218 echo "DummyReaderPluginSpi" >> META-INF/services/javax.imageio.spi.ImageReaderSpi
219
|