[OpenJDK 2D-Dev] RFR: 8225007: java/awt/print/PrinterJob/LandscapeStackOverflow.java may hang

Phil Race philip.race at oracle.com
Thu May 30 16:19:20 UTC 2019

On 5/29/19 11:18 PM, Jayathirth D V wrote:
> Hi,
> I was also looking into this test case under https://bugs.openjdk.java.net/browse/JDK-8224969 I will close it as duplicate of this bug.
> I saw that in case of Ubuntu and Mac we are throwing "java.awt.print.PrinterException: No print service found. " but I in case of Windows test just timesout.
> Since there was difference in behavior between different platforms I created product bug : https://bugs.openjdk.java.net/browse/JDK-8224961 . If difference in behavior is expected then we can close this issue.
Maybe keep it open until we can close out the conversation on this with 
an evaluation.

> Changes of adding @key printer under JDK-8225007 looks good to me.



> Thanks,
> Jay
> -----Original Message-----
> From: Sergey Bylokhov
> Sent: Thursday, May 30, 2019 7:07 AM
> To: Philip Race
> Cc: 2d-dev
> Subject: Re: [OpenJDK 2D-Dev] RFR: 8225007: java/awt/print/PrinterJob/LandscapeStackOverflow.java may hang
> On 29/05/2019 18:06, Philip Race wrote:
>> This test does not check. Nor does (IIRC) the implementation,
> [1] I guess it is checked in the RasterPrintJob.print() where the code call the getPrintService(). And getPrintService() returns null if there are no printers installed, as a result "new PrinterException("No print service found.") is thrown.
> I checked this test on win10 w/o printers installed and it pass but throw the next exception to the log[1]. But if I tries to print from the notepad it really suggest to install the printer.
>> because you want an experience like what you would get if you tried to
>> print from notepad, word, IE, whatever.
>> Which was to prompt you to install a printer if there is none.
>> That was the idea "back in the day" and is what happened on XP for
>> sure.>>  - When the test is executed the printer promts the location
>> to where store the pdf file(probably this location can be set to some
>> default and we will able to test printing as well at someday)
>> Even on a system with physical printers configured, if a pdf printer
>> is the default you could get prompted, but there is no API that I know of that can tell you this.
> I guess we need to documents this, since such "additional" windows from printers/onenotes etc may affect other tests.
>> -phil
>>> BTW this windows system was soooo slow so I was not able to move the mouse to select the file location, and have to reboot it....
>>>> -Phil.
>>>>> On May 29, 2019, at 3:40 PM, Phil Race <philip.race at oracle.com> wrote:
>>>>> If you try to print when there is no printer the behavior is not strictly specified.
>>>>> -Phil.
>>>>>>> On May 29, 2019, at 3:25 PM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
>>>>>>> On 29/05/2019 15:16, Philip Race wrote:
>>>>>>> It doesn't hang there. It hangs in print().
>>>>>> I guess it is even more strange, it hangs when tries to print to non-existent printer. I guess in this case the "new PrinterException("No print service found.")" should be thrown. It looks like a bug, no?
>>>>>>> -phil.
>>>>>>>>> On 5/29/19, 3:17 PM, Sergey Bylokhov wrote:
>>>>>>>>> On 29/05/2019 14:09, Phil Race wrote:
>>>>>>>>> think the mystery is not why it times out now, but why it did not do so earlier.
>>>>>>>> But I assume it if the system does not have the printer then PrinterJob.getPrinterJob() should not hang?
>>>>>>>> It looks like the test correctly assume that .getPrinterJob() should returns something even if there are no printers, and also tries to catch any exceptions in the print(); I guess its expectation are according the specification, isn't?
>>>>>> --
>>>>>> Best regards, Sergey.
> --
> Best regards, Sergey.

More information about the 2d-dev mailing list