Skip to content

Conversation

@anass-baya
Copy link
Contributor

@anass-baya anass-baya commented Oct 21, 2025

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 :

  • Removed yesno
  • Used PassFailJFrame manual test framework
  • add the missing keyboard 'test' to PolylinePrintingTest.java

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8320677: Printer tests use invalid '@run main/manual=yesno (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27916/head:pull/27916
$ git checkout pull/27916

Update a local copy of the PR:
$ git checkout pull/27916
$ git pull https://git.openjdk.org/jdk.git pull/27916/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27916

View PR using the GUI difftool:
$ git pr show -t 27916

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27916.diff

Using Webrev

Link to Webrev Comment

 test/jdk/java/awt/print/PrinterJob/PageRanges.java
 test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java
To use PassFailJFrame
@anass-baya anass-baya marked this pull request as draft October 21, 2025 14:14
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 21, 2025

👋 Welcome back abaya! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 21, 2025

@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:

8320677: Printer tests use invalid '@run main/manual=yesno

Reviewed-by: aivanov, dnguyen

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 master branch:

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 /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Oct 21, 2025
@openjdk
Copy link

openjdk bot commented Oct 21, 2025

@anass-baya The following label will be automatically applied to this pull request:

  • client

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.

@anass-baya anass-baya changed the title 8320677: Convert Printer tests to use PassFailJFrame 8320677: Printer tests use invalid '@run main/manual=yesno Oct 21, 2025
@anass-baya anass-baya marked this pull request as ready for review October 21, 2025 15:25
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 21, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 21, 2025

Webrevs

Comment on lines 50 to 51
PassFailJFrame passFailJFrame = new PassFailJFrame(INSTRUCTIONS);
passFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL);
Copy link
Member

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.

Copy link
Contributor Author

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()?

Copy link
Member

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.

@anass-baya anass-baya marked this pull request as draft October 21, 2025 22:27
@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 21, 2025
@anass-baya anass-baya marked this pull request as ready for review October 22, 2025 10:31
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 22, 2025
Comment on lines 52 to 62
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();
}
Copy link
Member

@aivanov-jdk aivanov-jdk Oct 22, 2025

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.

anass-baya and others added 2 commits October 22, 2025 12:14
Co-authored-by: Alexey Ivanov <alexey.ivanov@oracle.com>
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 22, 2025
@anass-baya
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 22, 2025
@openjdk
Copy link

openjdk bot commented Oct 22, 2025

@anass-baya
Your change (at version 4803d8a) is now ready to be sponsored by a Committer.

@sendaoYan
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 23, 2025

Going to push as commit ffcb158.
Since your change was applied there have been 321 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 23, 2025
@openjdk openjdk bot closed this Oct 23, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 23, 2025
@openjdk
Copy link

openjdk bot commented Oct 23, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants