jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh
author shurailine
Tue, 27 Oct 2015 20:06:02 -0700
changeset 33402 1156d495a525
parent 30376 2ccf2cf7ea48
child 40690 767d0e8ab1df
permissions -rw-r--r--
8140336: Add @modules for exported dependencies to jdk_core tests Reviewed-by: alanb, mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     1
#
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 16017
diff changeset
     2
# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     4
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     7
# published by the Free Software Foundation.
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     8
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    13
# accompanied this code).
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    14
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    18
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    21
# questions.
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    22
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    23
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    24
# @test
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    25
# @bug 7182152
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    26
# @bug 8007935
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    27
# @summary Redefine a subclass that implements two interfaces and
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    28
#   verify that the right methods are called.
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    29
# @author Daniel D. Daugherty
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    30
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    31
# @run shell MakeJAR3.sh RedefineSubclassWithTwoInterfacesAgent 'Can-Redefine-Classes: true'
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    32
# @run build RedefineSubclassWithTwoInterfacesApp
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    33
# @run shell RedefineSubclassWithTwoInterfaces.sh
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    34
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    35
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    36
if [ "${TESTJAVA}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    37
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    38
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    39
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    40
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    41
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    42
if [ "${COMPILEJAVA}" = "" ]
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    43
then
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    44
  COMPILEJAVA="${TESTJAVA}"
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    45
fi
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    46
echo "COMPILEJAVA=${COMPILEJAVA}"
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    47
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    48
if [ "${TESTSRC}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    49
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    50
  echo "TESTSRC not set.  Test cannot execute.  Failed."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    51
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    52
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    53
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    54
if [ "${TESTCLASSES}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    55
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    56
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    57
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    58
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    59
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    60
JAVAC="${COMPILEJAVA}"/bin/javac
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    61
JAVA="${TESTJAVA}"/bin/java
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    62
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    63
echo "INFO: building the replacement classes."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    64
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    65
cp "${TESTSRC}"/RedefineSubclassWithTwoInterfacesTarget_1.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    66
    RedefineSubclassWithTwoInterfacesTarget.java
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    67
cp "${TESTSRC}"/RedefineSubclassWithTwoInterfacesImpl_1.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    68
    RedefineSubclassWithTwoInterfacesImpl.java
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    69
"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    70
    -cp "${TESTCLASSES}" -d . \
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    71
    RedefineSubclassWithTwoInterfacesTarget.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    72
    RedefineSubclassWithTwoInterfacesImpl.java 
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    73
status="$?"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    74
if [ "$status" != 0 ]; then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    75
    echo "FAIL: compile of *_1.java files failed."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    76
    exit "$status"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    77
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    78
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    79
mv RedefineSubclassWithTwoInterfacesTarget.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    80
    RedefineSubclassWithTwoInterfacesTarget_1.java
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    81
mv RedefineSubclassWithTwoInterfacesTarget.class \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    82
    RedefineSubclassWithTwoInterfacesTarget_1.class
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    83
mv RedefineSubclassWithTwoInterfacesImpl.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    84
    RedefineSubclassWithTwoInterfacesImpl_1.java
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    85
mv RedefineSubclassWithTwoInterfacesImpl.class \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    86
    RedefineSubclassWithTwoInterfacesImpl_1.class
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    87
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    88
echo "INFO: launching RedefineSubclassWithTwoInterfacesApp"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    89
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    90
# TraceRedefineClasses options:
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    91
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    92
#    0x00000001 |          1 - name each target class before loading, after
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    93
#                              loading and after redefinition is completed
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    94
#    0x00000002 |          2 - print info if parsing, linking or
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    95
#                              verification throws an exception
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    96
#    0x00000004 |          4 - print timer info for the VM operation
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    97
#    0x00001000 |       4096 - detect calls to obsolete methods
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    98
#    0x00002000 |       8192 - fail a guarantee() in addition to detection
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    99
#    0x00004000 |      16384 - detect old/obsolete methods in metadata
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   100
#    0x00100000 |    1048576 - impl details: vtable updates
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   101
#    0x00200000 |    2097152 - impl details: itable updates
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   102
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   103
#    1+2+4+4096+8192+16384+1048576+2097152 == 3174407
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   104
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   105
"${JAVA}" ${TESTVMOPTS} \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   106
    -XX:TraceRedefineClasses=3174407 \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   107
    -javaagent:RedefineSubclassWithTwoInterfacesAgent.jar \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   108
    -classpath "${TESTCLASSES}" \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   109
    RedefineSubclassWithTwoInterfacesApp > output.log 2>&1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   110
status="$?"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   111
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   112
echo "INFO: <begin output.log>"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   113
cat output.log
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   114
echo "INFO: <end output.log>"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   115
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   116
if [ "$status" != 0 ]; then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   117
    echo "FAIL: RedefineSubclassWithTwoInterfacesApp failed."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   118
    exit "$status"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   119
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   120
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   121
# When this bug manifests, RedefineClasses() will fail to update
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   122
# one of the itable entries to refer to the new method. The log
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   123
# will include the following line when the bug occurs:
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   124
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   125
#     guarantee(false) failed: OLD and/or OBSOLETE method(s) found
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   126
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   127
# If this guarantee happens, the test should fail in the status
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   128
# check above, but just in case it doesn't, we check for "guarantee".
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   129
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   130
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   131
FAIL_MESG="guarantee"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   132
grep "$FAIL_MESG" output.log
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   133
status=$?
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   134
if [ "$status" = 0 ]; then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   135
    echo "FAIL: found '$FAIL_MESG' in the test output."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   136
    result=1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   137
else
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   138
    echo "INFO: did NOT find '$FAIL_MESG' in the test output."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   139
    # be optimistic here
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   140
    result=0
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   141
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   142
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   143
PASS1_MESG="before any redefines"
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   144
cnt=`grep "$PASS1_MESG" output.log | grep 'version-0' | wc -l`
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   145
# no quotes around $cnt so any whitespace from 'wc -l' is ignored
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   146
if [ $cnt = 2 ]; then
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   147
    echo "INFO: found 2 version-0 '$PASS1_MESG' mesgs."
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   148
else
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   149
    echo "FAIL: did NOT find 2 version-0 '$PASS1_MESG' mesgs."
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   150
    echo "INFO: cnt='$cnt'"
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   151
    echo "INFO: grep '$PASS1_MESG' output:"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   152
    grep "$PASS1_MESG" output.log
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   153
    result=1
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   154
fi
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   155
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   156
PASS2_MESG="after redefine"
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   157
cnt=`grep "$PASS2_MESG" output.log | grep 'version-1' | wc -l`
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   158
# no quotes around $cnt so any whitespace from 'wc -l' is ignored
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   159
if [ $cnt = 2 ]; then
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   160
    echo "INFO: found 2 version-1 '$PASS2_MESG' mesgs."
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   161
else
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   162
    echo "FAIL: did NOT find 2 version-1 '$PASS2_MESG' mesgs."
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   163
    echo "INFO: cnt='$cnt'"
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   164
    echo "INFO: grep '$PASS2_MESG' output:"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   165
    grep "$PASS2_MESG" output.log
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   166
    result=1
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   167
fi
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   168
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   169
if [ "$result" = 0 ]; then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   170
    echo "PASS: test passed both positive and negative output checks."
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   171
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   172
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   173
exit $result