On Mon, 4 Jan 2021 10:27:12 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> Test fails with timeout and it seems likely due to non-availability of
>> printer in the test system. We should just update the test to check for
>> default (or available) printers and return if there is no printer.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Fail the test if no printer is found
test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 50:
> 48: PrintService defaultPrtSrv =
> PrintServiceLookup.lookupDefaultPrintService();
> 49: if (printjob.getPrintService() == null || defaultPrtSrv == null) {
> 50: throw new RuntimeException("No printer found");
We need to make this more robust.
The checks should be before we create the pritner job and should be to find ANY
printer and none
throws the excepton, but if there is only a non-default one, set that as the
printer for the job after creating the job.
That may not matter on Windows but on other platforms I am sure you can have
printers, but not a default one.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1927