JDK-8272344 : [TEST_BUG] Automate PageDialogMarginTest.java test if possible
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-08-11
  • Updated: 2021-08-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Description
The java/awt/print/PrinterJob/PageDialogMarginTest.java test is a manual test. Can it be automated.

There's no direct access to the dialog displayed. However, it should become the active window when it's shown. Using AWTEventListener, it should be possible get a focus or activation event which would be confirmation the dialog is displayed. Alternatively KeyboardFocusManager could be used to check that there's a focused component, or an active window.

Then the Robot could press Alt+T to move focus to "top (in)" field and edit the value of the field: press Delete key to remove "1" and press "2" key to type 2. Pressing Enter would click OK and close the dialog.