1717N/A#
3743N/A# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
1717N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1717N/A#
1717N/A# This code is free software; you can redistribute it and/or modify it
1717N/A# under the terms of the GNU General Public License version 2 only, as
1717N/A# published by the Free Software Foundation.
1717N/A#
1717N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1717N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1717N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1717N/A# version 2 for more details (a copy is included in the LICENSE file that
1717N/A# accompanied this code).
1717N/A#
1717N/A# You should have received a copy of the GNU General Public License version
1717N/A# 2 along with this work; if not, write to the Free Software Foundation,
1717N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1717N/A#
1717N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1717N/A# or visit www.oracle.com if you need additional information or have any
1717N/A# questions.
1717N/A#
1635N/A
1717N/A
1635N/A# @test @(#)Test6626217.sh
1635N/A# @bug 6626217
1635N/A# @summary Loader-constraint table allows arrays instead of only the base-classes
1635N/A# @run shell Test6626217.sh
1635N/A#
4503N/A## some tests require path to find test source dir
1635N/Aif [ "${TESTSRC}" = "" ]
1635N/Athen
4503N/A TESTSRC=${PWD}
4503N/A echo "TESTSRC not set. Using "${TESTSRC}" as default"
1635N/Afi
4503N/Aecho "TESTSRC=${TESTSRC}"
4503N/A## Adding common setup Variables for running shell tests.
4503N/A. ${TESTSRC}/../../test_env.sh
1635N/A
1635N/AJAVA=${TESTJAVA}${FS}bin${FS}java
4503N/AJAVAC=${COMPILEJAVA}${FS}bin${FS}javac
1635N/A
1635N/A# Current directory is scratch directory, copy all the test source there
1635N/A# (for the subsequent moves to work).
4503N/A${CP} ${TESTSRC}${FS}* ${THIS_DIR}
1635N/A
1635N/A# A Clean Compile: this line will probably fail within jtreg as have a clean dir:
1635N/A${RM} -f *.class *.impl many_loader.java
1635N/A
1635N/A# Compile all the usual suspects, including the default 'many_loader'
1635N/A${CP} many_loader1.java.foo many_loader.java
4503N/A${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
1635N/A
1635N/A# Rename the class files, so the custom loader (and not the system loader) will find it
1635N/A${MV} from_loader2.class from_loader2.impl2
1635N/A
1635N/A# Compile the next version of 'many_loader'
1635N/A${MV} many_loader.class many_loader.impl1
1635N/A${CP} many_loader2.java.foo many_loader.java
4503N/A${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
1635N/A
1635N/A# Rename the class file, so the custom loader (and not the system loader) will find it
1635N/A${MV} many_loader.class many_loader.impl2
1635N/A${MV} many_loader.impl1 many_loader.class
1635N/A${RM} many_loader.java
1635N/A
3743N/A${JAVA} ${TESTVMOPTS} -Xverify -Xint -cp . bug_21227 >test.out 2>&1
1717N/Agrep "loader constraint" test.out
1635N/Aexit $?
1635N/A