author | michaelm |
Tue, 06 Mar 2012 20:34:38 +0000 | |
changeset 12047 | 320a714614e9 |
parent 7668 | d4a77089c587 |
child 14342 | 8435a30053c1 |
permissions | -rw-r--r-- |
2 | 1 |
# |
7668 | 2 |
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. |
|
8 |
# |
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
# accompanied this code). |
|
14 |
# |
|
15 |
# You should have received a copy of the GNU General Public License version |
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
# |
|
5506 | 19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
# or visit www.oracle.com if you need additional information or have any |
|
21 |
# questions. |
|
2 | 22 |
# |
23 |
||
24 |
# @test |
|
25 |
# @bug 5094825 |
|
26 |
# @summary verify no deadlock if crypto provider in other classloader is used to verify signed jars |
|
27 |
# |
|
28 |
# @run shell/timeout=30 ClassLoaderDeadlock.sh |
|
29 |
||
30 |
# set a few environment variables so that the shell-script can run stand-alone |
|
31 |
# in the source directory |
|
32 |
if [ "${TESTSRC}" = "" ] ; then |
|
33 |
TESTSRC="." |
|
34 |
fi |
|
35 |
||
36 |
if [ "${TESTCLASSES}" = "" ] ; then |
|
37 |
TESTCLASSES="." |
|
38 |
fi |
|
39 |
||
40 |
if [ "${TESTJAVA}" = "" ] ; then |
|
41 |
echo "TESTJAVA not set. Test cannot execute." |
|
42 |
echo "FAILED!!!" |
|
43 |
exit 1 |
|
44 |
fi |
|
45 |
||
46 |
# set platform-dependent variables |
|
47 |
OS=`uname -s` |
|
48 |
case "$OS" in |
|
49 |
SunOS ) |
|
50 |
PATHSEP=":" |
|
51 |
FILESEP="/" |
|
52 |
;; |
|
53 |
Linux ) |
|
54 |
PATHSEP=":" |
|
55 |
FILESEP="/" |
|
56 |
;; |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
57 |
Darwin ) |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
58 |
PATHSEP=":" |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
59 |
FILESEP="/" |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
60 |
;; |
3433 | 61 |
CYGWIN* ) |
62 |
PATHSEP=";" |
|
63 |
FILESEP="/" |
|
64 |
;; |
|
2 | 65 |
Windows* ) |
66 |
PATHSEP=";" |
|
67 |
FILESEP="\\" |
|
68 |
;; |
|
69 |
* ) |
|
70 |
echo "Unrecognized system!" |
|
71 |
exit 1; |
|
72 |
;; |
|
73 |
esac |
|
74 |
||
75 |
cd ${TESTCLASSES}${FILESEP} |
|
7285
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
76 |
if [ ! -d provider ] ; then |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
77 |
mkdir provider |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
78 |
fi |
2 | 79 |
|
80 |
# compile the test program |
|
81 |
${TESTJAVA}${FILESEP}bin${FILESEP}javac \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
82 |
-d ${TESTCLASSES}${FILESEP} \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
83 |
${TESTSRC}${FILESEP}ClassLoaderDeadlock.java |
2 | 84 |
|
85 |
${TESTJAVA}${FILESEP}bin${FILESEP}javac \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
86 |
-d ${TESTCLASSES}${FILESEP}provider${FILESEP} \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
87 |
${TESTSRC}${FILESEP}provider${FILESEP}HashProvider.java |
2 | 88 |
|
89 |
# run the test |
|
90 |
${TESTJAVA}${FILESEP}bin${FILESEP}java \ |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
91 |
-classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
92 |
-Djava.awt.headless=true \ |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
7668
diff
changeset
|
93 |
ClassLoaderDeadlock |
2 | 94 |
|
7285
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
95 |
STATUS=$? |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
96 |
|
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
97 |
# clean up |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
98 |
rm -f 'ClassLoaderDeadlock.class' 'ClassLoaderDeadlock$1.class' \ |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
99 |
'ClassLoaderDeadlock$DelayClassLoader.class' \ |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
100 |
provider${FILESEP}HashProvider.class |
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
101 |
|
18435d88d6dd
6203816: Can not run test/java/security/Security/ClassLoaderDeadlock.sh from the command line
valeriep
parents:
5506
diff
changeset
|
102 |
exit $STATUS |