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

8267161 : Write automated test case for JDK-4479161 #5058

Closed
wants to merge 9 commits into from

Conversation

lawrence-andrew
Copy link
Contributor

@lawrence-andrew lawrence-andrew commented Aug 9, 2021

  1. Automated the manual test case.
  2. Removed html dependent file
  3. Removed javax.swing.JApplet dependent.
  4. Test case can be executed independently as well with jtreg framework.
  5. Added methods to know that JFrame and Other component is visible before starting the user action via Robot.

@shurymury


Progress

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

Issue

  • JDK-8267161: Write automated test case for JDK-4479161

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5058

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 9, 2021

👋 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
Copy link

@openjdk openjdk bot commented Aug 9, 2021

@lawrence-andrew The following label will be automatically applied to this pull request:

  • awt

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 awt label Aug 9, 2021
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 10, 2021

@mrserb , thanks for reviewing. Created all the swing components within EDT

@lawrence-andrew lawrence-andrew changed the title 8267161:Write automated test case for JDK-4479161 8267161 : Write automated test case for JDK-4479161 Aug 10, 2021
@openjdk openjdk bot added the rfr label Aug 10, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 10, 2021

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 12, 2021

Sorry, missed disposed with in EDT added it now.

@openjdk openjdk bot removed the rfr label Aug 16, 2021
@openjdk openjdk bot added the rfr label Aug 16, 2021
mrserb
mrserb approved these changes Aug 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 16, 2021

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

8267161: Write automated test case for JDK-4479161

Reviewed-by: serb, 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 458 new commits pushed to the master branch:

  • 1ea437a: 8272720: Fix the implementation of loop unrolling heuristic with LoopPercentProfileLimit
  • 86add21: 8223923: C2: Missing interference with mismatched unsafe accesses
  • c701f6e: 8272739: Misformatted error message in EventHandlerCreator
  • fb1dfc6: 8267185: Add string deduplication support to ParallelGC
  • d874e96: 8271579: G1: Move copy before CAS in do_copy_to_survivor_space
  • 92bde67: 8271946: Cleanup leftovers in Space and subclasses
  • db9834f: 8258951: java/net/httpclient/HandshakeFailureTest.java failed with "RuntimeException: Not found expected SSLHandshakeException in java.io.IOException"
  • a81e5e9: 8272654: Mark word accesses should not use Access API
  • 4bd37c3: 8272708: [Test]: Cleanup: test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java no longer needs ocspEnabled
  • ddcd851: 8272602: [macos] not all KEY_PRESSED events sent when control modifier is used
  • ... and 448 more: https://git.openjdk.java.net/jdk/compare/92ae6a512340485f75a12479dc1c1b8d3261bc76...master

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 (@mrserb, @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 label Aug 16, 2021
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 16, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 16, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 16, 2021

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

test/jdk/java/awt/im/4959409/bug4959409.java Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 16, 2021

Thanks @aivanov-jdk aivanov-jdk for reviewing. Yes, I can fixes your review.

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 17, 2021

@aivanov-jdk , fixed all the comments that you have asked for.

@openjdk openjdk bot removed the sponsor label Aug 17, 2021
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Aug 19, 2021

Hi Lawrence,

I played a bit with the test and it looks it can be simplified.

First of all, jTextField.isVisible is always true. So it makes no sense to check its value.

As for the frame, you have ComponentListener which decreases the value of frameVisibleLatch. Alternatively, you could use WindowListener and its windowOpened. Once the frame is displayed, the text field is also displayed.

So it looks like the code could be simplified to the following:

    SwingUtilities.invokeAndWait( /* create the frame and components */);

    robot.waitForIdle();
    if (!frameVisibleLatch.await(TIMEOUT, TimeUnit.SECONDS)) {
        new RuntimeException("Frame is not visible after " + TIMEOUT + "  seconds");
    }
    
    robot.waitForIdle();
    performMouseAction();
    // And so on

What do you think?

I suggest renaming performMouseAction to something more specific and descriptive, like clickTextField — this way the purpose of the action / method is obvious without opening its code.

test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
test/jdk/java/awt/im/4959409/bug4959409.java Outdated Show resolved Hide resolved
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 20, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 20, 2021

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

@aivanov-jdk
Copy link
Member

@aivanov-jdk aivanov-jdk commented Aug 20, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Aug 20, 2021

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

  • 1ea437a: 8272720: Fix the implementation of loop unrolling heuristic with LoopPercentProfileLimit
  • 86add21: 8223923: C2: Missing interference with mismatched unsafe accesses
  • c701f6e: 8272739: Misformatted error message in EventHandlerCreator
  • fb1dfc6: 8267185: Add string deduplication support to ParallelGC
  • d874e96: 8271579: G1: Move copy before CAS in do_copy_to_survivor_space
  • 92bde67: 8271946: Cleanup leftovers in Space and subclasses
  • db9834f: 8258951: java/net/httpclient/HandshakeFailureTest.java failed with "RuntimeException: Not found expected SSLHandshakeException in java.io.IOException"
  • a81e5e9: 8272654: Mark word accesses should not use Access API
  • 4bd37c3: 8272708: [Test]: Cleanup: test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java no longer needs ocspEnabled
  • ddcd851: 8272602: [macos] not all KEY_PRESSED events sent when control modifier is used
  • ... and 448 more: https://git.openjdk.java.net/jdk/compare/92ae6a512340485f75a12479dc1c1b8d3261bc76...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 20, 2021
@openjdk openjdk bot added integrated and removed ready rfr sponsor labels Aug 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 20, 2021

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

💡 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
awt integrated
3 participants