annotate test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh @ 6581:cea72c2bf071

7197491: update copyright year to match last edit in jdk8 jdk repository Reviewed-by: chegar, ksrini
author alanb
date Fri, 02 Nov 2012 15:50:11 +0000
parents d45bc4307996
children ae5d04dbacd6
rev   line source
valeriep@1042 1 #
alanb@6581 2 # Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
valeriep@1042 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
valeriep@1042 4 #
valeriep@1042 5 # This code is free software; you can redistribute it and/or modify it
valeriep@1042 6 # under the terms of the GNU General Public License version 2 only, as
valeriep@1042 7 # published by the Free Software Foundation.
valeriep@1042 8 #
valeriep@1042 9 # This code is distributed in the hope that it will be useful, but WITHOUT
valeriep@1042 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
valeriep@1042 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
valeriep@1042 12 # version 2 for more details (a copy is included in the LICENSE file that
valeriep@1042 13 # accompanied this code).
valeriep@1042 14 #
valeriep@1042 15 # You should have received a copy of the GNU General Public License version
valeriep@1042 16 # 2 along with this work; if not, write to the Free Software Foundation,
valeriep@1042 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
valeriep@1042 18 #
ohair@2362 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 20 # or visit www.oracle.com if you need additional information or have any
ohair@2362 21 # questions.
valeriep@1042 22 #
valeriep@1042 23 # @test
valeriep@1042 24 # @bug 4735126
michaelm@5177 25 # @summary (cl) ClassLoader.loadClass locks all instances in chain
valeriep@1042 26 # when delegating
michaelm@5177 27 #
alanb@4407 28 # @run shell TestOneWayDelegate.sh
valeriep@1042 29
valeriep@1042 30 # if running by hand on windows, change TESTSRC and TESTCLASSES to "."
valeriep@1042 31 if [ "${TESTSRC}" = "" ] ; then
valeriep@1042 32 TESTSRC=`pwd`
valeriep@1042 33 fi
valeriep@1042 34 if [ "${TESTCLASSES}" = "" ] ; then
valeriep@1042 35 TESTCLASSES=`pwd`
valeriep@1042 36 fi
valeriep@1042 37
valeriep@1042 38 # if running by hand on windows, change this to appropriate value
valeriep@1042 39 if [ "${TESTJAVA}" = "" ] ; then
valeriep@1042 40 echo "TESTJAVA not set. Test cannot execute."
valeriep@1042 41 echo "FAILED!!!"
valeriep@1042 42 exit 1
valeriep@1042 43 fi
valeriep@1042 44 echo TESTSRC=${TESTSRC}
valeriep@1042 45 echo TESTCLASSES=${TESTCLASSES}
valeriep@1042 46 echo TESTJAVA=${TESTJAVA}
valeriep@1042 47 echo ""
valeriep@1042 48
valeriep@1042 49 # set platform-specific variables
valeriep@1042 50 OS=`uname -s`
valeriep@1042 51 case "$OS" in
valeriep@1042 52 SunOS )
valeriep@1042 53 FS="/"
valeriep@1042 54 ;;
valeriep@1042 55 Linux )
valeriep@1042 56 FS="/"
valeriep@1042 57 ;;
michaelm@5177 58 Darwin )
michaelm@5177 59 FS="/"
michaelm@5177 60 ;;
ohair@2076 61 Windows* | CYGWIN* )
valeriep@1042 62 FS="\\"
valeriep@1042 63 ;;
valeriep@1042 64 esac
valeriep@1042 65
valeriep@1042 66 # compile test
valeriep@1042 67 ${TESTJAVA}${FS}bin${FS}javac \
valeriep@1042 68 -d ${TESTCLASSES} \
valeriep@1042 69 ${TESTSRC}${FS}Starter.java ${TESTSRC}${FS}DelegatingLoader.java
valeriep@1042 70
valeriep@1042 71 STATUS=$?
valeriep@1042 72 if [ ${STATUS} -ne 0 ]
valeriep@1042 73 then
valeriep@1042 74 exit ${STATUS}
valeriep@1042 75 fi
valeriep@1042 76
valeriep@1042 77 # set up test
valeriep@1042 78 ${TESTJAVA}${FS}bin${FS}javac \
valeriep@1042 79 -d ${TESTCLASSES}${FS} \
valeriep@1042 80 ${TESTSRC}${FS}Alice.java ${TESTSRC}${FS}SupBob.java \
valeriep@1042 81 ${TESTSRC}${FS}Bob.java ${TESTSRC}${FS}SupAlice.java
valeriep@1042 82
valeriep@1042 83 cd ${TESTCLASSES}
valeriep@1042 84 DIRS="SA SB"
valeriep@1042 85 for dir in $DIRS
valeriep@1042 86 do
valeriep@1042 87 if [ -d ${dir} ]; then
valeriep@1042 88 rm -rf ${dir}
valeriep@1042 89 fi
valeriep@1042 90 mkdir ${dir}
valeriep@1042 91 mv com${dir} ${dir}
valeriep@1042 92 done
valeriep@1042 93
valeriep@1042 94 # run test
valeriep@1042 95 ${TESTJAVA}${FS}bin${FS}java \
valeriep@1042 96 -verbose:class -XX:+TraceClassLoading -cp . \
valeriep@1042 97 -Dtest.classes=${TESTCLASSES} \
valeriep@1042 98 Starter one-way
valeriep@1042 99 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
valeriep@1042 100
valeriep@1042 101 # save error status
valeriep@1042 102 STATUS=$?
valeriep@1042 103
valeriep@1042 104 # clean up
valeriep@1042 105 rm -rf ${TESTCLASSES}${FS}SA ${TESTCLASSES}${FS}SB
valeriep@1042 106
valeriep@1042 107 # return
valeriep@1042 108 exit ${STATUS}