RFR: 8270609: [TESTBUG] java/awt/print/Dialog/DialogCopies.java does not show instruction

Alexey Ivanov aivanov at openjdk.java.net
Wed Sep 15 15:59:57 UTC 2021


On Tue, 14 Sep 2021 18:37:49 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> Is it possible to complete the test as soon as either OK or Cancel button is clicked on the Print dialog?

The `init()` method is run on main thread. It's the thread which creates the Print Dialog. If the user clicks Cancel, the `job.printDialog()` returns `false` and the test should fail.

Then if the `job.getCopies() == 1`, the test also fails with the message that the number of copies wasn't increased.

If `job.getCopies() > 1`, the test passes automatically.


There's one thing though… I don't have a real printer installed but I have a PDF printer which doesn't allow increasing the number of copies. What should the test do in this case? If I click OK without modifying the number of copies, the test will fail; if I click Cancel, the test will also fail. However, this particular case falls into a category where the prerequisites aren't met.

Probably, the standard machinery with `Sysout` is an overkill for this simple scenario. You could show the instruction frame with only the text area which contains the instruction text.

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

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



More information about the client-libs-dev mailing list