Test6626217.sh revision 5776:de6a9e811145
11541Srgrimes# 
21541Srgrimes#  Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
31541Srgrimes#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41541Srgrimes# 
51541Srgrimes#  This code is free software; you can redistribute it and/or modify it
61541Srgrimes#  under the terms of the GNU General Public License version 2 only, as
71541Srgrimes#  published by the Free Software Foundation.
81541Srgrimes# 
91541Srgrimes#  This code is distributed in the hope that it will be useful, but WITHOUT
101541Srgrimes#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
111541Srgrimes#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
121541Srgrimes#  version 2 for more details (a copy is included in the LICENSE file that
131541Srgrimes#  accompanied this code).
141541Srgrimes# 
151541Srgrimes#  You should have received a copy of the GNU General Public License version
161541Srgrimes#  2 along with this work; if not, write to the Free Software Foundation,
171541Srgrimes#  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
181541Srgrimes# 
191541Srgrimes#  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
201541Srgrimes#  or visit www.oracle.com if you need additional information or have any
211541Srgrimes#  questions.
221541Srgrimes# 
231541Srgrimes
241541Srgrimes
251541Srgrimes# @ignore 8028733
261541Srgrimes# @test @(#)Test6626217.sh
271541Srgrimes# @bug 6626217
281541Srgrimes# @summary Loader-constraint table allows arrays instead of only the base-classes
291541Srgrimes# @run shell Test6626217.sh
301541Srgrimes#
311541Srgrimes## some tests require path to find test source dir
321541Srgrimesif [ "${TESTSRC}" = "" ]
331541Srgrimesthen
3450477Speter  TESTSRC=${PWD}
351541Srgrimes  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
361541Srgrimesfi
3713203Swollmanecho "TESTSRC=${TESTSRC}"
381541Srgrimes## Adding common setup Variables for running shell tests.
391541Srgrimes. ${TESTSRC}/../../test_env.sh
402112Swollman
4176166SmarkmJAVA=${TESTJAVA}${FS}bin${FS}java
4276166SmarkmJAVAC=${COMPILEJAVA}${FS}bin${FS}javac
4312221Sbde
4441059Speter# Current directory is scratch directory, copy all the test source there
451541Srgrimes# (for the subsequent moves to work).
4624131Sbde${CP} ${TESTSRC}${FS}* ${THIS_DIR}
471541Srgrimes
481541Srgrimes# A Clean Compile: this line will probably fail within jtreg as have a clean dir:
491541Srgrimes${RM} -f *.class *.impl many_loader.java
501541Srgrimes
5174927Sjhb# Compile all the usual suspects, including the default 'many_loader'
521541Srgrimes${CP} many_loader1.java.foo many_loader.java
5372786Srwatson${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
541541Srgrimes
5530354Sphk# Rename the class files, so the custom loader (and not the system loader) will find it
5630309Sphk${MV} from_loader2.class from_loader2.impl2
5713203Swollman
5812819Sphk# Compile the next version of 'many_loader'
5962378Sgreen${MV} many_loader.class many_loader.impl1
6012819Sphk${CP} many_loader2.java.foo many_loader.java
6112819Sphk${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
6212819Sphk
6312577Sbde# Rename the class file, so the custom loader (and not the system loader) will find it
6412819Sphk${MV} many_loader.class many_loader.impl2
6512819Sphk${MV} many_loader.impl1 many_loader.class
661541Srgrimes${RM} many_loader.java
671541Srgrimes
681541Srgrimes${JAVA} ${TESTVMOPTS} -Xverify -Xint -cp . bug_21227 >test.out 2>&1
691541Srgrimesgrep "loader constraint" test.out
701541Srgrimesexit $?
711541Srgrimes
728876Srgrimes