jdk/test/java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh
author ykantser
Thu, 07 May 2015 09:11:49 +0200
changeset 30376 2ccf2cf7ea48
parent 16017 0742f7c261fe
child 33402 1156d495a525
permissions -rw-r--r--
8078896: Add @modules as needed to the jdk_svc 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
#
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 16017
diff changeset
    31
# @modules java.instrument
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    32
# @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
    33
# @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
    34
# @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
    35
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    36
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    37
if [ "${TESTJAVA}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    38
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    39
  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
    40
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    41
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    42
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    43
if [ "${COMPILEJAVA}" = "" ]
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    44
then
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    45
  COMPILEJAVA="${TESTJAVA}"
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    46
fi
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    47
echo "COMPILEJAVA=${COMPILEJAVA}"
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    48
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    49
if [ "${TESTSRC}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    50
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    51
  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
    52
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    53
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    54
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    55
if [ "${TESTCLASSES}" = "" ]
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    56
then
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    57
  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
    58
  exit 1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    59
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    60
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    61
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
    62
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
    63
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    64
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
    65
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    66
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
    67
    RedefineSubclassWithTwoInterfacesTarget.java
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    68
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
    69
    RedefineSubclassWithTwoInterfacesImpl.java
15669
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    70
"${JAVAC}" ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
0923fe344df6 8007935: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh should use $COMPILEJAVA for javac
dcubed
parents: 15654
diff changeset
    71
    -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
    72
    RedefineSubclassWithTwoInterfacesTarget.java \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    73
    RedefineSubclassWithTwoInterfacesImpl.java 
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    74
status="$?"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    75
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
    76
    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
    77
    exit "$status"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    78
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    79
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    80
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
    81
    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
    82
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
    83
    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
    84
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
    85
    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
    86
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
    87
    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
    88
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    89
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
    90
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    91
# TraceRedefineClasses options:
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    92
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
    93
#    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
    94
#                              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
    95
#    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
    96
#                              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
    97
#    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
    98
#    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
    99
#    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
   100
#    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
   101
#    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
   102
#    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
   103
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   104
#    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
   105
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   106
"${JAVA}" ${TESTVMOPTS} \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   107
    -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
   108
    -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
   109
    -classpath "${TESTCLASSES}" \
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   110
    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
   111
status="$?"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   112
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   113
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
   114
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
   115
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
   116
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   117
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
   118
    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
   119
    exit "$status"
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   120
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   121
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   122
# 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
   123
# 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
   124
# 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
   125
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   126
#     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
   127
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   128
# 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
   129
# 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
   130
#
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   131
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   132
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
   133
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
   134
status=$?
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   135
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
   136
    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
   137
    result=1
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   138
else
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   139
    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
   140
    # 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
   141
    result=0
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   142
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   143
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   144
PASS1_MESG="before any redefines"
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   145
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
   146
# 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
   147
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
   148
    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
   149
else
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   150
    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
   151
    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
   152
    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
   153
    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
   154
    result=1
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   155
fi
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   156
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   157
PASS2_MESG="after redefine"
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   158
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
   159
# 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
   160
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
   161
    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
   162
else
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   163
    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
   164
    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
   165
    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
   166
    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
   167
    result=1
16017
0742f7c261fe 8008352: java/lang/instrument/RedefineSubclassWithTwoInterfaces.sh fails on MKS
dcubed
parents: 15669
diff changeset
   168
fi
15654
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   169
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   170
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
   171
    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
   172
fi
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   173
aa1e472aa6b9 8007420: add test for 6805864 to com/sun/jdi, add test for 7182152 to java/lang/instrument
dcubed
parents:
diff changeset
   174
exit $result