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