Skip to content

Commit 1724e0a

Browse files
authored
Verify printer availability at the beginning of the test execution
1 parent b3ce6cf commit 1724e0a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/jdk/java/awt/print/PrinterJob/PageRanges.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ In the second dialog, select ALL, to print all pages (in total 5 pages).
5151

5252
public static void main(String args[]) throws Exception {
5353
PrinterJob job = PrinterJob.getPrinterJob();
54-
if(job == null) {
54+
if(job.getPrintService() == null) {
5555
throw new SkippedException("Printer not configured or available.");
5656
}
5757

@@ -61,10 +61,6 @@ public static void main(String args[]) throws Exception {
6161
.columns(45)
6262
.build();
6363

64-
if (job.getPrintService() == null) {
65-
System.out.println("No printer available");
66-
PassFailJFrame.forcePass();
67-
}
6864
job.setPrintable(new PageRanges());
6965
if (job.printDialog()) {
7066
job.print();

0 commit comments

Comments
 (0)