Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/tools/native2ascii/resources/ImmutableResourceTest.sh
38918 views
#1# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#2223# @test24# @bug 628757925# @summary SubClasses of ListResourceBundle should fix getContents()26# @author Tim Bell27#28# @run shell ImmutableResourceTest.sh29#30#3132# Beginning of subroutines:33status=13435#Call this from anywhere to fail the test with an error message36# usage: fail "reason why the test failed"37fail()38{ echo "The test failed :-("39echo "$*" 1>&240echo "exit status was $status"41exit $status42} #end of fail()4344#Call this from anywhere to pass the test with a message45# usage: pass "reason why the test passed if applicable"46pass()47{ echo "The test passed!!!"48echo "$*" 1>&249exit 050} #end of pass()5152# end of subroutines5354# The beginning of the script proper5556OS=`uname -s`57case "$OS" in58SunOS | Linux | Darwin | AIX )59PATHSEP=":"60;;6162Windows* | CYGWIN*)63PATHSEP=";"64;;6566# catch all other OSs67* )68echo "Unrecognized system! $OS"69fail "Unrecognized system! $OS"70;;71esac7273TARGETCLASS="ImmutableResourceTest"74if [ -z "${TESTJAVA}" ] ; then75# TESTJAVA is not set, so the test is running stand-alone.76# TESTJAVA holds the path to the root directory of the build of the JDK77# to be tested. That is, any java files run explicitly in this shell78# should use TESTJAVA in the path to the java interpreter.79# So, we'll set this to the JDK spec'd on the command line. If none80# is given on the command line, tell the user that and use a default.81# THIS IS THE JDK BEING TESTED.82if [ -n "$1" ] ; then83TESTJAVA=$184else85TESTJAVA=$JAVA_HOME86fi87TESTSRC=.88TESTCLASSES=.89#Deal with .class files:90fi91#92echo "JDK under test is: $TESTJAVA"93#94CP="-classpath ${TESTCLASSES}${PATHSEP}${TESTJAVA}/lib/tools.jar"95# Compile the test class using the classpath we need:96#97env98#99set -vx100#101#Compile. tools.jar is required on the classpath.102${TESTJAVA}/bin/javac -d "${TESTCLASSES}" ${CP} -g \103"${TESTSRC}"/"${TARGETCLASS}".java104#105#Run the test class, again with the classpath we need:106${TESTJAVA}/bin/java ${CP} ${TARGETCLASS}107status=$?108echo "test status was: $status"109if [ $status -eq "0" ];110then pass ""111112else fail "unspecified test failure"113fi114115116