jdk/test/java/lang/instrument/ParallelTransformerLoader.sh
author dcubed
Mon, 24 Mar 2008 15:05:09 -0700
changeset 272 c4e0a3afe6f2
child 2638 d4447065286a
permissions -rw-r--r--
5088398: 3/2 java.lang.instrument TCK test deadlock (test11) Summary: Add regression test for single-threaded bootstrap classloader. Reviewed-by: sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
272
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     1
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     2
# Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     4
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     7
# published by the Free Software Foundation.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     8
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    13
# accompanied this code).
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    14
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    18
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    21
# have any questions.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    22
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    23
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    24
# @test
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    25
# @bug 5088398
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    26
# @summary Test parallel class loading by parallel transformers.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    27
# @author Daniel D. Daugherty as modified from the code of Daryl Puryear @ Wily
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    28
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    29
# @run shell MakeJAR3.sh ParallelTransformerLoaderAgent
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    30
# @run build ParallelTransformerLoaderApp
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    31
# @run shell/timeout=240 ParallelTransformerLoader.sh
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    32
#
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    33
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    34
if [ "${TESTJAVA}" = "" ]
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    35
then
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    36
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    37
  exit 1
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    38
fi
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    39
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    40
if [ "${TESTSRC}" = "" ]
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    41
then
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    42
  echo "TESTSRC not set.  Test cannot execute.  Failed."
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    43
  exit 1
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    44
fi
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    45
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    46
if [ "${TESTCLASSES}" = "" ]
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    47
then
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    48
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    49
  exit 1
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    50
fi
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    51
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    52
JAR="${TESTJAVA}"/bin/jar
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    53
JAVAC="${TESTJAVA}"/bin/javac
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    54
JAVA="${TESTJAVA}"/bin/java
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    55
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    56
"${JAVAC}" -d . \
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    57
    "${TESTSRC}"/TestClass1.java \
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    58
    "${TESTSRC}"/TestClass2.java \
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    59
    "${TESTSRC}"/TestClass3.java
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    60
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    61
"${JAR}" cvf Test.jar Test*.class
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    62
# Removing the test class files is important. If these
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    63
# .class files are available on the classpath other
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    64
# than via Test.jar, then the deadlock will not reproduce.
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    65
rm -f Test*.class
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    66
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    67
"${JAVA}" ${TESTVMOPTS} -javaagent:ParallelTransformerLoaderAgent.jar=Test.jar \
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    68
    -classpath "${TESTCLASSES}" ParallelTransformerLoaderApp
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    69
result=$?
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    70
echo "result=$result"
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    71
c4e0a3afe6f2 5088398: 3/2 java.lang.instrument TCK test deadlock (test11)
dcubed
parents:
diff changeset
    72
exit $result