On Wed, 6 Jan 2021 06:35:20 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> test/jdk/java/awt/print/PrinterJob/LandscapeStackOverflow.java line 46:
>> 
>>> 44: 
>>> 45:     public static final void main( String[] parameters ) throws 
>>> Exception {
>>> 46:         PrintService[] printService = PrinterJob.lookupPrintServices();
>> 
>> As far as I understand and comment in my previouse comment, if the 
>> lookupPrintServices() return empty array then the "PrinterJob.print()" will 
>> throw the same PrinterException("No print service found");
>> 
>> And if default printer is not set, and we have some other printers then 
>> "PrinterJob.print()" will select some non-default printer already, isn't it?
>> 
>> I meant that we just duplicate an existed checks, and both of them wll not 
>> work. If the system has some non-real printers like XPS, or "print to PDF" 
>> then such printers will be count  by the "PrinterJob.lookupPrintServices()" 
>> so no exception will be thrown and the test just hands suggestion the user 
>> to save the printed document somewhere. The hang occur exactly where it is 
>> reported in JBS "WPrinterJob._startDoc".
>> 
>> I can reproduce it on the freshly installed Windows.
>
> I'm not sure we can avoid this if user selects "print to pdf" as default 
> printservice or if it is the only printservice available. Maybe converting it 
> to manual is the way to go.

We can update the documentation "testing.html" about the "printer" keyword and 
describe how to skip/run the tests marked by this keyword. or we can just close 
the bug as not-a-defect.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1927

Reply via email to