RFR: 8296920: Regression Test DialogOrient.java fails on MacOS
Prasanta Sadhukhan
psadhukhan at openjdk.org
Fri May 19 11:26:51 UTC 2023
On Wed, 17 May 2023 21:48:01 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> Test was failing with PrinterException: Wrong Orientation since printing was done with default orientation.
>> Fix is made to set the printable with correct PageFormat
>>
>> It was not seen prior to [JDK-8262731](https://bugs.openjdk.org/browse/JDK-8262731) probably because the exception was being swallowed..
>
> test/jdk/java/awt/print/Dialog/DialogOrient.java line 73:
>
>> 71: PrinterJob job = PrinterJob.getPrinterJob();
>> 72: PageFormat landscape = job.pageDialog(job.defaultPage());
>> 73: job.setPrintable(new DialogOrient(), landscape);
>
> why doesn't job.setPrintable(DialogOrient) work here? doesn't job.pageDialog already set the job orientation to landscape?
https://docs.oracle.com/en/java/javase/20/docs/api/java.desktop/java/awt/print/PrinterJob.html#setPrintable(java.awt.print.Printable)
says "The [PageFormat](file:///D:/jdk-17.0.1_doc-all/docs/api/java.desktop/java/awt/print/PageFormat.html) for each page is the default page format."
which is Portrait so it seems prudent to pass the pageformat modified in pageDialog to setPrintable
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13950#discussion_r1198853598
More information about the client-libs-dev
mailing list