author | jmasa |
Sun, 02 Aug 2009 19:10:31 -0700 | |
changeset 3587 | 0140e816d000 |
parent 548 | caed182cee6e |
child 5506 | 202f599c92aa |
permissions | -rw-r--r-- |
548
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
1 |
#!/bin/sh |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
2 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
3 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
4 |
# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
6 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
7 |
# This code is free software; you can redistribute it and/or modify it |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
9 |
# published by the Free Software Foundation. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
10 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
15 |
# accompanied this code). |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
16 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
20 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
23 |
# have any questions. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
24 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
25 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
26 |
# @test |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
27 |
# @bug 6662775 |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
28 |
# @summary Tests queuePrintJob is sufficient permission. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
29 |
# @run clean PrintSE |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
30 |
# @run build PrintSE |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
31 |
# @run compile PrintSE.java |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
32 |
# @run shell/timeout=300 PrintSE.sh |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
33 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
34 |
echo ------------------------------------------------------------- |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
35 |
echo Launching test for `basename $0 .sh` |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
36 |
echo ------------------------------------------------------------- |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
37 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
38 |
createJavaPolicyFile() |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
39 |
{ |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
40 |
cat << EOF > ${TESTCLASSES}/print.policy |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
41 |
grant { |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
42 |
permission java.lang.RuntimePermission "queuePrintJob"; |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
43 |
}; |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
44 |
EOF |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
45 |
} |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
46 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
47 |
createJavaPolicyFile |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
48 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
49 |
${TESTJAVA}/bin/java -Djava.security.manager -Djava.security.policy=${TESTCLASSES}/print.policy -cp ${TESTCLASSES} PrintSE |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
50 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
51 |
exit $? |