8231463: Fix runtime/RedefineTests/RedefineDoubleDelete.java test in 8u jdk8u232-b08

Thu, 26 Sep 2019 06:56:38 +0100

author
zgu
date
Thu, 26 Sep 2019 06:56:38 +0100
changeset 9754
4170228e11e6
parent 9753
15a65d1c8924
child 9755
12177d88b89c

8231463: Fix runtime/RedefineTests/RedefineDoubleDelete.java test in 8u
Reviewed-by: andrew

test/runtime/RedefineTests/RedefineDoubleDelete.java file | annotate | diff | comparison | revisions
test/runtime/RedefineTests/test8178870.sh file | annotate | diff | comparison | revisions
     1.1 --- a/test/runtime/RedefineTests/RedefineDoubleDelete.java	Wed Jun 26 01:15:51 2019 +0000
     1.2 +++ b/test/runtime/RedefineTests/RedefineDoubleDelete.java	Thu Sep 26 06:56:38 2019 +0100
     1.3 @@ -24,7 +24,11 @@
     1.4  /*
     1.5   * @test
     1.6   * @bug 8178870
     1.7 + * @library /testlibrary
     1.8   * @summary Redefine class with CFLH twice to test deleting the cached_class_file
     1.9 + * @build RedefineClassHelper
    1.10 + * @run main RedefineClassHelper
    1.11 + * @run main/othervm -javaagent:redefineagent.jar RedefineDoubleDelete
    1.12   */
    1.13  
    1.14  public class RedefineDoubleDelete {
     2.1 --- a/test/runtime/RedefineTests/test8178870.sh	Wed Jun 26 01:15:51 2019 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,87 +0,0 @@
     2.4 -#!/bin/sh
     2.5 -
     2.6 -#
     2.7 -# Copyright (c) 2019, Red Hat, Inc. All rights reserved.
     2.8 -#
     2.9 -# This code is free software; you can redistribute it and/or modify it
    2.10 -# under the terms of the GNU General Public License version 2 only, as
    2.11 -# published by the Free Software Foundation.
    2.12 -#
    2.13 -# This code is distributed in the hope that it will be useful, but WITHOUT
    2.14 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.15 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.16 -# version 2 for more details (a copy is included in the LICENSE file that
    2.17 -# accompanied this code).
    2.18 -#
    2.19 -# You should have received a copy of the GNU General Public License version
    2.20 -# 2 along with this work; if not, write to the Free Software Foundation,
    2.21 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.22 -#
    2.23 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.24 -# or visit www.oracle.com if you need additional information or have any
    2.25 -# questions.
    2.26 -#
    2.27 -#
    2.28 -
    2.29 -## @test test.sh
    2.30 -## @bug 8178870
    2.31 -## @summary test instrumentation.retransformClasses
    2.32 -## @run shell test.sh
    2.33 -
    2.34 -if [ "${TESTSRC}" = "" ]
    2.35 -then
    2.36 -  TESTSRC=${PWD}
    2.37 -  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
    2.38 -fi
    2.39 -echo "TESTSRC=${TESTSRC}"
    2.40 -## Adding common setup Variables for running shell tests.
    2.41 -. ${TESTSRC}/../../test_env.sh
    2.42 -
    2.43 -LIB_SRC=${TESTSRC}/../../testlibrary/
    2.44 -
    2.45 -# set platform-dependent variables
    2.46 -OS=`uname -s`
    2.47 -echo "Testing on " $OS
    2.48 -case "$OS" in
    2.49 -  Linux)
    2.50 -    cc_cmd=`which gcc`
    2.51 -    if [ "x$cc_cmd" == "x" ]; then
    2.52 -        echo "WARNING: gcc not found. Cannot execute test." 2>&1
    2.53 -        exit 0;
    2.54 -    fi
    2.55 -    ;;
    2.56 -  Solaris)
    2.57 -    cc_cmd=`which cc`
    2.58 -    if [ "x$cc_cmd" == "x" ]; then
    2.59 -        echo "WARNING: cc not found. Cannot execute test." 2>&1
    2.60 -        exit 0;
    2.61 -    fi
    2.62 -    ;;
    2.63 -  *)
    2.64 -    echo "Test passed. Only on Linux and Solaris"
    2.65 -    exit 0;
    2.66 -    ;;
    2.67 -esac
    2.68 -
    2.69 -THIS_DIR=.
    2.70 -
    2.71 -cp ${TESTSRC}/RedefineDoubleDelete.java ${THIS_DIR}
    2.72 -mkdir -p ${THIS_DIR}/classes
    2.73 -${TESTJAVA}/bin/javac -sourcepath  ${LIB_SRC} -d ${THIS_DIR}/classes ${LIB_SRC}RedefineClassHelper.java
    2.74 -${TESTJAVA}/bin/javac -cp .:${THIS_DIR}/classes:${TESTJAVA}/lib/tools.jar -d ${THIS_DIR} RedefineDoubleDelete.java
    2.75 -
    2.76 -$cc_cmd -fPIC -shared -o ${THIS_DIR}${FS}libRedefineDoubleDelete.so \
    2.77 -    -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
    2.78 -    ${TESTSRC}/libRedefineDoubleDelete.c
    2.79 -
    2.80 -LD_LIBRARY_PATH=${THIS_DIR}
    2.81 -echo   LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}
    2.82 -export LD_LIBRARY_PATH
    2.83 -
    2.84 -# Install redefineagent.jar
    2.85 -${TESTJAVA}/bin${FS}java -cp ${THIS_DIR}/classes RedefineClassHelper
    2.86 -
    2.87 -echo
    2.88 -echo ${TESTJAVA}/bin/java -agentlib:RedefineDoubleDelete RedefineDoubleDelete
    2.89 -${TESTJAVA}/bin/java -cp .:${THIS_DIR}${FS}classes -javaagent:redefineagent.jar -agentlib:RedefineDoubleDelete RedefineDoubleDelete
    2.90 -

mercurial