acorn@2152: # kevinw@3777: # Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. acorn@2152: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. acorn@2152: # acorn@2152: # This code is free software; you can redistribute it and/or modify it acorn@2152: # under the terms of the GNU General Public License version 2 only, as acorn@2152: # published by the Free Software Foundation. acorn@2152: # acorn@2152: # This code is distributed in the hope that it will be useful, but WITHOUT acorn@2152: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or acorn@2152: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License acorn@2152: # version 2 for more details (a copy is included in the LICENSE file that acorn@2152: # accompanied this code). acorn@2152: # acorn@2152: # You should have received a copy of the GNU General Public License version acorn@2152: # 2 along with this work; if not, write to the Free Software Foundation, acorn@2152: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. acorn@2152: # acorn@2152: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA acorn@2152: # or visit www.oracle.com if you need additional information or have any acorn@2152: # questions. acorn@2152: # asaha@2070: acorn@2152: asaha@2070: # @test @(#)Test6626217.sh asaha@2070: # @bug 6626217 asaha@2070: # @summary Loader-constraint table allows arrays instead of only the base-classes asaha@2070: # @run shell Test6626217.sh asaha@2070: # asaha@2070: asaha@2070: if [ "${TESTSRC}" = "" ] asaha@2070: then TESTSRC=. asaha@2070: fi asaha@2070: asaha@2070: if [ "${TESTJAVA}" = "" ] asaha@2070: then asaha@2070: PARENT=`dirname \`which java\`` asaha@2070: TESTJAVA=`dirname ${PARENT}` asaha@2070: echo "TESTJAVA not set, selecting " ${TESTJAVA} asaha@2070: echo "If this is incorrect, try setting the variable manually." asaha@2070: fi asaha@2070: asaha@2070: if [ "${TESTCLASSES}" = "" ] asaha@2070: then asaha@2070: echo "TESTCLASSES not set. Test cannot execute. Failed." asaha@2070: exit 1 asaha@2070: fi asaha@2070: asaha@2070: # set platform-dependent variables asaha@2070: OS=`uname -s` asaha@2070: case "$OS" in coleenp@3985: SunOS | Linux | Darwin ) asaha@2070: NULL=/dev/null asaha@2070: PS=":" asaha@2070: FS="/" asaha@2070: RM=/bin/rm asaha@2070: CP=/bin/cp asaha@2070: MV=/bin/mv asaha@2070: ;; asaha@2070: Windows_* ) asaha@2070: NULL=NUL asaha@2070: PS=";" asaha@2070: FS="\\" asaha@2070: RM=rm asaha@2070: CP=cp asaha@2070: MV=mv asaha@2070: ;; coleenp@4022: CYGWIN_* ) coleenp@4022: NULL=/dev/null coleenp@4022: PS=";" coleenp@4022: FS="/" coleenp@4022: RM=rm coleenp@4022: CP=cp coleenp@4022: MV=mv coleenp@4022: ;; asaha@2070: * ) asaha@2070: echo "Unrecognized system!" asaha@2070: exit 1; asaha@2070: ;; asaha@2070: esac asaha@2070: asaha@2070: JEMMYPATH=${CPAPPEND} asaha@2070: CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH asaha@2070: asaha@2070: THIS_DIR=`pwd` asaha@2070: asaha@2070: JAVA=${TESTJAVA}${FS}bin${FS}java asaha@2070: JAVAC=${TESTJAVA}${FS}bin${FS}javac asaha@2070: kevinw@3777: ${JAVA} ${TESTVMOPTS} -version asaha@2070: asaha@2070: # Current directory is scratch directory, copy all the test source there asaha@2070: # (for the subsequent moves to work). asaha@2070: ${CP} ${TESTSRC}${FS}* ${THIS_DIR} asaha@2070: asaha@2070: # A Clean Compile: this line will probably fail within jtreg as have a clean dir: asaha@2070: ${RM} -f *.class *.impl many_loader.java asaha@2070: asaha@2070: # Compile all the usual suspects, including the default 'many_loader' asaha@2070: ${CP} many_loader1.java.foo many_loader.java asaha@2070: ${JAVAC} -source 1.4 -target 1.4 -Xlint *.java asaha@2070: asaha@2070: # Rename the class files, so the custom loader (and not the system loader) will find it asaha@2070: ${MV} from_loader2.class from_loader2.impl2 asaha@2070: asaha@2070: # Compile the next version of 'many_loader' asaha@2070: ${MV} many_loader.class many_loader.impl1 asaha@2070: ${CP} many_loader2.java.foo many_loader.java asaha@2070: ${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java asaha@2070: asaha@2070: # Rename the class file, so the custom loader (and not the system loader) will find it asaha@2070: ${MV} many_loader.class many_loader.impl2 asaha@2070: ${MV} many_loader.impl1 many_loader.class asaha@2070: ${RM} many_loader.java asaha@2070: kevinw@3777: ${JAVA} ${TESTVMOPTS} -Xverify -Xint -cp . bug_21227 >test.out 2>&1 acorn@2152: grep "loader constraint" test.out asaha@2070: exit $? asaha@2070: