-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8320677: Printer tests use invalid '@run main/manual=yesno #27916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to use PassFailJFrame
|
👋 Welcome back abaya! A progress list of the required criteria for merging this PR into |
|
@anass-baya This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 320 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aivanov-jdk, @DamonGuy) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@anass-baya The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
| PassFailJFrame passFailJFrame = new PassFailJFrame(INSTRUCTIONS); | ||
| passFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use PassFailJFrame.builder() to configure and create an instance of PassFailJFrame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @aivanov-jdk,
Thank you for your review.
I used this approach to position the instruction window on the left side of the screen so that it won’t be hidden by the print dialog.
Is it possible to do something similar with the PassFailJFrame.builder()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The builder supports all the features that you can get when using a PassFailJFrame constructor and more.
When you have no test UI, the instructions frame will stay at the centre of the screen when you use the builder. When you call PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL), the instructions frame is still moved to the left as if there's a test window.
| public static void main(String[] args) throws Exception { | ||
| PassFailJFrame passFailJFrame = PassFailJFrame.builder() | ||
| .instructions(INSTRUCTIONS) | ||
| .rows((int) INSTRUCTIONS.lines().count() + 2) | ||
| .columns(45) | ||
| .build(); | ||
|
|
||
| new PolylinePrintingTest(); | ||
|
|
||
| passFailJFrame.awaitAndCheck(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This second test may also throw jtreg.SkippedException if the printer is not available. Then you can remove this statement from the instructions.
I would also place the test code inside the main method as it's done in the PageRanges.java test.
I also think setting the page format and paper isn't necessary to reproduce the original bug JDK-8041902, so this can be removed from the test, which will make the code small enough to inline into the main method.
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
…ot available - Enhancments
|
/integrate |
|
@anass-baya |
|
/sponsor |
|
Going to push as commit ffcb158.
Your commit was automatically rebased without conflicts. |
|
@sendaoYan @anass-baya Pushed as commit ffcb158. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The tests :
test/jdk/java/awt/print/PrinterJob/PolylinePrintingTest.java
test/jdk/java/awt/print/PrinterJob/PageRanges.java
were failing because the Argument yesno to 'manual' option is invalid
the fix is as follow :
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27916/head:pull/27916$ git checkout pull/27916Update a local copy of the PR:
$ git checkout pull/27916$ git pull https://git.openjdk.org/jdk.git pull/27916/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27916View PR using the GUI difftool:
$ git pr show -t 27916Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27916.diff
Using Webrev
Link to Webrev Comment