test/runtime/6626217/Test6626217.sh

Fri, 03 Feb 2012 18:04:11 -0800

author
amurillo
date
Fri, 03 Feb 2012 18:04:11 -0800
changeset 3509
4e9b30938cbf
parent 2152
883a82d6d41d
child 3777
037973617842
permissions
-rw-r--r--

Added tag hs23-b13 for changeset b22de8247499

acorn@2152 1 #
acorn@2152 2 # Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
acorn@2152 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
acorn@2152 4 #
acorn@2152 5 # This code is free software; you can redistribute it and/or modify it
acorn@2152 6 # under the terms of the GNU General Public License version 2 only, as
acorn@2152 7 # published by the Free Software Foundation.
acorn@2152 8 #
acorn@2152 9 # This code is distributed in the hope that it will be useful, but WITHOUT
acorn@2152 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
acorn@2152 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
acorn@2152 12 # version 2 for more details (a copy is included in the LICENSE file that
acorn@2152 13 # accompanied this code).
acorn@2152 14 #
acorn@2152 15 # You should have received a copy of the GNU General Public License version
acorn@2152 16 # 2 along with this work; if not, write to the Free Software Foundation,
acorn@2152 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
acorn@2152 18 #
acorn@2152 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
acorn@2152 20 # or visit www.oracle.com if you need additional information or have any
acorn@2152 21 # questions.
acorn@2152 22 #
asaha@2070 23
acorn@2152 24
asaha@2070 25 # @test @(#)Test6626217.sh
asaha@2070 26 # @bug 6626217
asaha@2070 27 # @summary Loader-constraint table allows arrays instead of only the base-classes
asaha@2070 28 # @run shell Test6626217.sh
asaha@2070 29 #
asaha@2070 30
asaha@2070 31 if [ "${TESTSRC}" = "" ]
asaha@2070 32 then TESTSRC=.
asaha@2070 33 fi
asaha@2070 34
asaha@2070 35 if [ "${TESTJAVA}" = "" ]
asaha@2070 36 then
asaha@2070 37 PARENT=`dirname \`which java\``
asaha@2070 38 TESTJAVA=`dirname ${PARENT}`
asaha@2070 39 echo "TESTJAVA not set, selecting " ${TESTJAVA}
asaha@2070 40 echo "If this is incorrect, try setting the variable manually."
asaha@2070 41 fi
asaha@2070 42
asaha@2070 43 if [ "${TESTCLASSES}" = "" ]
asaha@2070 44 then
asaha@2070 45 echo "TESTCLASSES not set. Test cannot execute. Failed."
asaha@2070 46 exit 1
asaha@2070 47 fi
asaha@2070 48
asaha@2070 49 BIT_FLAG=""
asaha@2070 50
asaha@2070 51 # set platform-dependent variables
asaha@2070 52 OS=`uname -s`
asaha@2070 53 case "$OS" in
asaha@2070 54 SunOS | Linux )
asaha@2070 55 NULL=/dev/null
asaha@2070 56 PS=":"
asaha@2070 57 FS="/"
asaha@2070 58 RM=/bin/rm
asaha@2070 59 CP=/bin/cp
asaha@2070 60 MV=/bin/mv
asaha@2070 61 ## for solaris, linux it's HOME
asaha@2070 62 FILE_LOCATION=$HOME
asaha@2070 63 if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
asaha@2070 64 then
asaha@2070 65 BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT`
asaha@2070 66 fi
asaha@2070 67 ;;
asaha@2070 68 Windows_* )
asaha@2070 69 NULL=NUL
asaha@2070 70 PS=";"
asaha@2070 71 FS="\\"
asaha@2070 72 RM=rm
asaha@2070 73 CP=cp
asaha@2070 74 MV=mv
asaha@2070 75 ;;
asaha@2070 76 * )
asaha@2070 77 echo "Unrecognized system!"
asaha@2070 78 exit 1;
asaha@2070 79 ;;
asaha@2070 80 esac
asaha@2070 81
asaha@2070 82 JEMMYPATH=${CPAPPEND}
asaha@2070 83 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
asaha@2070 84
asaha@2070 85 THIS_DIR=`pwd`
asaha@2070 86
asaha@2070 87 JAVA=${TESTJAVA}${FS}bin${FS}java
asaha@2070 88 JAVAC=${TESTJAVA}${FS}bin${FS}javac
asaha@2070 89
asaha@2070 90 ${JAVA} ${BIT_FLAG} -version
asaha@2070 91
asaha@2070 92 # Current directory is scratch directory, copy all the test source there
asaha@2070 93 # (for the subsequent moves to work).
asaha@2070 94 ${CP} ${TESTSRC}${FS}* ${THIS_DIR}
asaha@2070 95
asaha@2070 96 # A Clean Compile: this line will probably fail within jtreg as have a clean dir:
asaha@2070 97 ${RM} -f *.class *.impl many_loader.java
asaha@2070 98
asaha@2070 99 # Compile all the usual suspects, including the default 'many_loader'
asaha@2070 100 ${CP} many_loader1.java.foo many_loader.java
asaha@2070 101 ${JAVAC} -source 1.4 -target 1.4 -Xlint *.java
asaha@2070 102
asaha@2070 103 # Rename the class files, so the custom loader (and not the system loader) will find it
asaha@2070 104 ${MV} from_loader2.class from_loader2.impl2
asaha@2070 105
asaha@2070 106 # Compile the next version of 'many_loader'
asaha@2070 107 ${MV} many_loader.class many_loader.impl1
asaha@2070 108 ${CP} many_loader2.java.foo many_loader.java
asaha@2070 109 ${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java
asaha@2070 110
asaha@2070 111 # Rename the class file, so the custom loader (and not the system loader) will find it
asaha@2070 112 ${MV} many_loader.class many_loader.impl2
asaha@2070 113 ${MV} many_loader.impl1 many_loader.class
asaha@2070 114 ${RM} many_loader.java
asaha@2070 115
asaha@2070 116 ${JAVA} ${BIT_FLAG} -Xverify -Xint -cp . bug_21227 >test.out 2>&1
acorn@2152 117 grep "loader constraint" test.out
asaha@2070 118 exit $?
asaha@2070 119

mercurial