test/jdk/javax/print/PrintSE/PrintSE.sh
author kbarrett
Wed, 13 Nov 2019 18:00:30 -0500
changeset 59067 f080b08daace
parent 47216 71c04702a3d5
permissions -rw-r--r--
8232588: G1 concurrent System.gc can return early or late 8233279: G1: GCLocker GC with +GCLockerInvokesConcurrent spins while cycle in progress Summary: Refactor G1CH::try_collect and fix bugs with concurrent collections. Reviewed-by: tschatzl, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
#
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 22965
diff changeset
     4
# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
548
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 548
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 548
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 548
diff changeset
    23
# questions.
548
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
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 22965
diff changeset
    27
# @key printer
548
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    28
# @bug 6662775
46151
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 22965
diff changeset
    29
# @summary Tests queuePrintJob is sufficient permission for printing. This test 
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 22965
diff changeset
    30
#          prints a page to a printer. If a document printer is installed, a 
5fa789776f7d 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
goetz
parents: 22965
diff changeset
    31
#          popup can appear (to select the file location).
548
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    32
# @run clean PrintSE
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    33
# @run build PrintSE
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    34
# @run compile PrintSE.java
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    35
# @run shell/timeout=300 PrintSE.sh
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    36
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    37
echo -------------------------------------------------------------
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    38
echo Launching test for `basename $0 .sh`
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    39
echo -------------------------------------------------------------
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    40
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    41
createJavaPolicyFile()
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    42
{
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    43
   cat << EOF > ${TESTCLASSES}/print.policy
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    44
grant {
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    45
 permission java.lang.RuntimePermission "queuePrintJob";
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
EOF
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
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    50
createJavaPolicyFile
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    51
22965
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 5506
diff changeset
    52
${TESTJAVA}/bin/java ${TESTVMOPTS} \
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 5506
diff changeset
    53
    -Djava.security.manager \
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 5506
diff changeset
    54
    -Djava.security.policy=${TESTCLASSES}/print.policy \
78610fb00fff 8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents: 5506
diff changeset
    55
    -cp ${TESTCLASSES} PrintSE
548
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    56
caed182cee6e 6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff changeset
    57
exit $?