author | serb |
Tue, 29 Mar 2016 17:03:18 +0300 | |
changeset 36787 | 402e5e40f6e5 |
parent 34721 | 59801fbd042e |
permissions | -rw-r--r-- |
34721
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
1 |
#!/bin/sh |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
2 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
3 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
4 |
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
6 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
7 |
# This code is free software; you can redistribute it and/or modify it |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
9 |
# published by the Free Software Foundation. |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
10 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
15 |
# accompanied this code). |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
16 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
20 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
23 |
# questions. |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
24 |
# |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
25 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
26 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
27 |
# @test |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
28 |
# @bug 8145750 |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
29 |
# @summary jjs fails to run simple scripts with security manager turned on |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
30 |
# @run shell jjs-cpTest.sh |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
31 |
# Tests -cp/-classpath option to set the classpath for jjs |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
32 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
33 |
. ${TESTSRC-.}/common.sh |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
34 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
35 |
setup |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
36 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
37 |
rm -f Hello.class |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
38 |
${JAVAC} ${TESTSRC}/Hello.java -d . |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
39 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
40 |
# we check whether classpath setting for app classes |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
41 |
# work with jjs. Script should be able to |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
42 |
# access Java class "Hello". |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
43 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
44 |
${JJS} -J-Djava.security.manager -cp . ${TESTSRC}/classpath.js |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
45 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
46 |
if [ $? -ne 0 ]; then |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
47 |
exit 1 |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
48 |
fi |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
49 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
50 |
# -classpath and -cp are synonyms |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
51 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
52 |
${JJS} -J-Djava.security.manager -classpath . ${TESTSRC}/classpath.js |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
53 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
54 |
if [ $? -ne 0 ]; then |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
55 |
exit 1 |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
56 |
fi |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
57 |
|
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
58 |
rm -f Hello.class |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
59 |
echo "Passed" |
59801fbd042e
8145750: jjs fails to run simple scripts with security manager turned on
sundar
parents:
diff
changeset
|
60 |
exit 0 |