4555N/A#
4555N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
4555N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4555N/A#
4555N/A# This code is free software; you can redistribute it and/or modify it
4555N/A# under the terms of the GNU General Public License version 2 only, as
4555N/A# published by the Free Software Foundation.
4555N/A#
4555N/A# This code is distributed in the hope that it will be useful, but WITHOUT
4555N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4555N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4555N/A# version 2 for more details (a copy is included in the LICENSE file that
4555N/A# accompanied this code).
4555N/A#
4555N/A# You should have received a copy of the GNU General Public License version
4555N/A# 2 along with this work; if not, write to the Free Software Foundation,
4555N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4555N/A#
4555N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4555N/A# or visit www.oracle.com if you need additional information or have any
4555N/A# questions.
4555N/A#
4555N/A
4555N/A# @test
4555N/A# @bug 7121600
4555N/A# @summary Redefine a big class.
4555N/A# @author Daniel D. Daugherty
4555N/A#
4555N/A# @run shell MakeJAR3.sh RedefineBigClassAgent 'Can-Redefine-Classes: true'
4555N/A# @run build BigClass RedefineBigClassApp
4555N/A# @run shell/timeout=600 RedefineBigClass.sh
4555N/A#
4555N/A
4555N/Aif [ "${TESTJAVA}" = "" ]
4555N/Athen
4555N/A echo "TESTJAVA not set. Test cannot execute. Failed."
4555N/A exit 1
4555N/Afi
4555N/A
4555N/Aif [ "${TESTSRC}" = "" ]
4555N/Athen
4555N/A echo "TESTSRC not set. Test cannot execute. Failed."
4555N/A exit 1
4555N/Afi
4555N/A
4555N/Aif [ "${TESTCLASSES}" = "" ]
4555N/Athen
4555N/A echo "TESTCLASSES not set. Test cannot execute. Failed."
4555N/A exit 1
4555N/Afi
4555N/A
4555N/AJAVAC="${TESTJAVA}"/bin/javac
4555N/AJAVA="${TESTJAVA}"/bin/java
4555N/A
4555N/A"${JAVA}" ${TESTVMOPTS} \
4555N/A -XX:TraceRedefineClasses=3 \
4555N/A -javaagent:RedefineBigClassAgent.jar=BigClass.class \
4555N/A -classpath "${TESTCLASSES}" RedefineBigClassApp \
4555N/A > output.log 2>&1
4555N/Aresult=$?
4555N/A
4555N/Acat output.log
4555N/A
4555N/Aif [ "$result" = 0 ]; then
4555N/A echo "PASS: RedefineBigClassApp exited with status of 0."
4555N/Aelse
4555N/A echo "FAIL: RedefineBigClassApp exited with status of $result"
4555N/A exit "$result"
4555N/Afi
4555N/A
4555N/AMESG="Exception"
4555N/Agrep "$MESG" output.log
4555N/Aresult=$?
4555N/Aif [ "$result" = 0 ]; then
4555N/A echo "FAIL: found '$MESG' in the test output"
4555N/A result=1
4555N/Aelse
4555N/A echo "PASS: did NOT find '$MESG' in the test output"
4555N/A result=0
4555N/Afi
4555N/A
4555N/Aexit $result