1# 2# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# This code is free software; you can redistribute it and/or modify it 6# under the terms of the GNU General Public License version 2 only, as 7# published by the Free Software Foundation. 8# 9# This code is distributed in the hope that it will be useful, but WITHOUT 10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12# version 2 for more details (a copy is included in the LICENSE file that 13# accompanied this code). 14# 15# You should have received a copy of the GNU General Public License version 16# 2 along with this work; if not, write to the Free Software Foundation, 17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18# 19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20# or visit www.oracle.com if you need additional information or have any 21# questions. 22# 23 24# 25# @test 26# @bug 6287579 27# @summary SubClasses of ListResourceBundle should fix getContents() 28# @author Tim Bell 29# 30# @modules jdk.jdi/com.sun.tools.example.debug.tty 31# 32# @run shell ImmutableResourceTest.sh 33# 34 35# Beginning of subroutines: 36status=1 37 38#Call this from anywhere to fail the test with an error message 39# usage: fail "reason why the test failed" 40fail() 41 { echo "The test failed :-(" 42 echo "$*" 1>&2 43 echo "exit status was $status" 44 exit $status 45 } #end of fail() 46 47#Call this from anywhere to pass the test with a message 48# usage: pass "reason why the test passed if applicable" 49pass() 50 { echo "The test passed!!!" 51 echo "$*" 1>&2 52 exit 0 53 } #end of pass() 54 55# end of subroutines 56 57# The beginning of the script proper 58 59OS=`uname -s` 60case "$OS" in 61 SunOS | Linux | Darwin | AIX ) 62 PATHSEP=":" 63 ;; 64 65 Windows* | CYGWIN*) 66 PATHSEP=";" 67 ;; 68 69 # catch all other OSs 70 * ) 71 echo "Unrecognized system! $OS" 72 fail "Unrecognized system! $OS" 73 ;; 74esac 75 76TARGETCLASS="ImmutableResourceTest" 77if [ -z "${TESTJAVA}" ] ; then 78 # TESTJAVA is not set, so the test is running stand-alone. 79 # TESTJAVA holds the path to the root directory of the build of the JDK 80 # to be tested. That is, any java files run explicitly in this shell 81 # should use TESTJAVA in the path to the java interpreter. 82 # So, we'll set this to the JDK spec'd on the command line. If none 83 # is given on the command line, tell the user that and use a default. 84 # THIS IS THE JDK BEING TESTED. 85 if [ -n "$1" ] ; then 86 TESTJAVA=$1 87 else 88 TESTJAVA=$JAVA_HOME 89 fi 90 TESTSRC=. 91 TESTCLASSES=. 92 #Deal with .class files: 93fi 94# 95echo "JDK under test is: $TESTJAVA" 96# 97CP="-classpath ${TESTCLASSES}" 98# 99env 100# 101set -vx 102# 103# Compile test class 104${TESTJAVA}/bin/javac --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ 105 -d "${TESTCLASSES}" ${CP} -g "${TESTSRC}"/"${TARGETCLASS}".java 106# 107# Run the test class, again with the classpath we need: 108${TESTJAVA}/bin/java --add-exports jdk.jdi/com.sun.tools.example.debug.tty=ALL-UNNAMED \ 109 ${CP} ${TARGETCLASS} 110status=$? 111echo "test status was: $status" 112if [ $status -eq "0" ]; 113 then pass "" 114 115 else fail "unspecified test failure" 116fi 117