Skip to content
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

8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test #8004

Closed
wants to merge 12 commits into from

Conversation

lawrence-andrew
Copy link
Contributor

@lawrence-andrew lawrence-andrew commented Mar 28, 2022

Fixed the following issue.

  1. Removed yes/no since test was failing due to "Parser error due to yesno in @run main/manual=yesno"
  2. After removing yes/no test run( just shows the UI and gets dispose immediately). User cannot interact with the test UI and mark the test pass or failed.
    So added Pass and Fail button to mark the test result.
  3. Added timeout if in case user does not interact with the test UI.

@shurymury
@aivanov-jdk


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issues

  • JDK-8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test
  • JDK-8284898: Enhance PassFailJFrame

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8004/head:pull/8004
$ git checkout pull/8004

Update a local copy of the PR:
$ git checkout pull/8004
$ git pull https://git.openjdk.java.net/jdk pull/8004/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8004

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8004.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 28, 2022

👋 Welcome back lawrence-andrew! 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 openjdk bot added the rfr Pull request is ready for review label Mar 28, 2022
@openjdk
Copy link

openjdk bot commented Mar 28, 2022

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

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Mar 28, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 28, 2022

Copy link
Contributor

@prsadhuk prsadhuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you wait for the framework in PR#7966 to be reviewed and completed and use it here instead of recreating UI in each test, to maintain consistency.

private Frame frame;
private volatile boolean failed = false;
private volatile String testFailedReason;
static final String INSTRUCTIONS =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to use the already existing support for manual tests?

@lawrence-andrew lawrence-andrew changed the title 8283803 : Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test 8284898 : Enhance PassFailJFrame Apr 14, 2022
@lawrence-andrew
Copy link
Contributor Author

/issue 8283803

@openjdk
Copy link

openjdk bot commented Apr 14, 2022

@lawrence-andrew
Adding additional issue to issue list: 8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test.

Button printButton = new Button("PRINT");
PrinterJob pj = PrinterJob.getPrinterJob();
if (pj == null || pj.getPrintService() == null) {
System.out.println("Printer not configured or available."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise the test was already doing the pj == null check but per. the spec, this shouldn't happen
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/print/PrinterJob.html#getPrinterJob()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, and IDE generates a warning: pj == null is always false. I suggest removing this condition and thus resolving the warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit of optimisation: you can postpone creating the test frame. The frame is not needed if the test passes because there's no print service.

Copy link
Contributor

@prrace prrace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving since I think the minor things I pointed out aren't problems for the test

@openjdk
Copy link

openjdk bot commented Apr 16, 2022

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

8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test
8284898: Enhance PassFailJFrame

Reviewed-by: prr, aivanov

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 73 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 (@prsadhuk, @prrace, @aivanov-jdk) 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 ready Pull request is ready to be integrated label Apr 16, 2022
@lawrence-andrew
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 17, 2022
@openjdk
Copy link

openjdk bot commented Apr 17, 2022

@lawrence-andrew
Your change (at version 0d971ba) is now ready to be sponsored by a Committer.

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java Outdated Show resolved Hide resolved
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java Outdated Show resolved Hide resolved
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java Outdated Show resolved Hide resolved
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java Outdated Show resolved Hide resolved
Button printButton = new Button("PRINT");
PrinterJob pj = PrinterJob.getPrinterJob();
if (pj == null || pj.getPrintService() == null) {
System.out.println("Printer not configured or available."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, and IDE generates a warning: pj == null is always false. I suggest removing this condition and thus resolving the warning.

Button printButton = new Button("PRINT");
PrinterJob pj = PrinterJob.getPrinterJob();
if (pj == null || pj.getPrintService() == null) {
System.out.println("Printer not configured or available."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a bit of optimisation: you can postpone creating the test frame. The frame is not needed if the test passes because there's no print service.

@aivanov-jdk
Copy link
Member

I think the main issue fixed should remain: 8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test as it was originally.

The one that's main now: 8284898: Enhance PassFailJFrame should really be secondary.

@aivanov-jdk
Copy link
Member

Both modified files contain a couple of unused imports.

@lawrence-andrew lawrence-andrew changed the title 8284898 : Enhance PassFailJFrame 8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java Apr 19, 2022
@lawrence-andrew
Copy link
Contributor Author

/issue 8284898

@openjdk
Copy link

openjdk bot commented Apr 19, 2022

⚠️ @lawrence-andrew This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Apr 19, 2022
@openjdk
Copy link

openjdk bot commented Apr 19, 2022

@lawrence-andrew
Adding additional issue to issue list: 8284898: Enhance PassFailJFrame.

@openjdk openjdk bot changed the title 8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java 8283803: Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test Apr 19, 2022
Comment on lines 119 to 123
long testTimeout = TimeUnit.MINUTES.toMillis(testTimeOutInMinutes);
long tTimeout = TimeUnit.MINUTES.toMillis(testTimeOut);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could probably reused testTimeout:

testTimeOut = TimeUnit.MINUTES.toMillis(testTimeOut);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testTimeOut is used with in lambda hence it should be final. So I just created a new variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Yes, lambdas and anonymous classes require final or effectively final variables.

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java Outdated Show resolved Hide resolved
@aivanov-jdk
Copy link
Member

You probably need to use /issue remove 8283803 to remove duplicate entry from the commit message.

@lawrence-andrew
Copy link
Contributor Author

/issue remove 8283803

@openjdk
Copy link

openjdk bot commented Apr 19, 2022

@lawrence-andrew
Removing additional issue from issue list: 8283803.

@lawrence-andrew
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 19, 2022
@openjdk
Copy link

openjdk bot commented Apr 19, 2022

@lawrence-andrew
Your change (at version c555124) is now ready to be sponsored by a Committer.

@lawrence-andrew
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added sponsor Pull request is ready to be sponsored and removed sponsor Pull request is ready to be sponsored labels Apr 19, 2022
@openjdk
Copy link

openjdk bot commented Apr 19, 2022

@lawrence-andrew
Your change (at version 796e393) is now ready to be sponsored by a Committer.

@aivanov-jdk
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 19, 2022

Going to push as commit ed23033.
Since your change was applied there have been 73 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 Apr 19, 2022
@openjdk openjdk bot closed this Apr 19, 2022
@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 Apr 19, 2022
@openjdk
Copy link

openjdk bot commented Apr 19, 2022

@aivanov-jdk @lawrence-andrew Pushed as commit ed23033.

💡 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
5 participants