author | jjh |
Wed, 15 Aug 2012 13:48:46 -0700 | |
changeset 13631 | dc1212c348f9 |
parent 12084 | b367473ef0f1 |
permissions | -rw-r--r-- |
10 | 1 |
# |
13631
dc1212c348f9
7191449: update copyright year to match last edit in jdk8 langtools repository
jjh
parents:
12084
diff
changeset
|
2 |
# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
# |
|
5520 | 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. |
|
10 | 22 |
# |
23 |
||
24 |
# @test |
|
25 |
# @bug 4087314 4800342 |
|
26 |
# @summary Verify allowed access to protected class from another package. |
|
27 |
# @author William Maddox (maddox) |
|
28 |
# |
|
29 |
# @run shell ProtectedInnerClass.sh |
|
30 |
||
31 |
||
32 |
if [ "${TESTSRC}" = "" ] |
|
33 |
then |
|
34 |
echo "TESTSRC not set. Test cannot execute. Failed." |
|
35 |
exit 1 |
|
36 |
fi |
|
37 |
echo "TESTSRC=${TESTSRC}" |
|
38 |
if [ "${TESTJAVA}" = "" ] |
|
39 |
then |
|
40 |
echo "TESTJAVA not set. Test cannot execute. Failed." |
|
41 |
exit 1 |
|
42 |
fi |
|
43 |
echo "TESTJAVA=${TESTJAVA}" |
|
44 |
if [ "${TESTCLASSES}" = "" ] |
|
45 |
then |
|
46 |
echo "TESTCLASSES not set. Test cannot execute. Failed." |
|
47 |
exit 1 |
|
48 |
fi |
|
49 |
echo "TESTCLASSES=${TESTCLASSES}" |
|
50 |
echo "CLASSPATH=${CLASSPATH}" |
|
51 |
||
52 |
# set platform-dependent variables |
|
53 |
OS=`uname -s` |
|
54 |
case "$OS" in |
|
12084
b367473ef0f1
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
5520
diff
changeset
|
55 |
SunOS | Linux | Darwin ) |
10 | 56 |
PS=":" |
57 |
FS="/" |
|
58 |
;; |
|
3772 | 59 |
CYGWIN* ) |
60 |
PS=";" # native PS, not Cygwin PS |
|
61 |
FS="/" |
|
62 |
;; |
|
10 | 63 |
Windows* ) |
64 |
PS=";" |
|
65 |
FS="\\" |
|
66 |
;; |
|
67 |
* ) |
|
68 |
echo "Unrecognized system!" |
|
69 |
exit 1; |
|
70 |
;; |
|
71 |
esac |
|
72 |
||
73 |
rm -f ${TESTCLASSES}${FS}p1${FS}*.class ${TESTCLASSES}${FS}p2${FS}*.class |
|
74 |
||
75 |
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TESTCLASSES}" "${TESTSRC}${FS}p1${FS}ProtectedInnerClass1.java" "${TESTSRC}${FS}p2${FS}ProtectedInnerClass2.java" |
|
76 |
"${TESTJAVA}${FS}bin${FS}java" ${TESTVMOPTS} -classpath "${CLASSPATH}${PS}${TESTCLASSES}" p2.ProtectedInnerClass2 |
|
77 |
result=$? |
|
78 |
if [ $result -eq 0 ] |
|
79 |
then |
|
80 |
echo "Passed" |
|
81 |
else |
|
82 |
echo "Failed" |
|
83 |
fi |
|
84 |
exit $result |