-
Notifications
You must be signed in to change notification settings - Fork 6.2k
JDK-8353755 : Add a helper method to Util - findComponent() #27944
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
|
👋 Welcome back honkar! A progress list of the required criteria for merging this PR into |
|
@honkar-jdk 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 302 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. ➡️ To integrate this PR with the above commit message to the |
|
@honkar-jdk 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
|
|
@TejeshR13 please review |
honkar-jdk
left a comment
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.
@aivanov-jdk
Updated. Please re-review.
TejeshR13
left a comment
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.
Any reason for updating the test files with this PR ? I feel this PR should be restricted to Util file updates alone, updating the test files can be taken up separately.
| robot.mouseMove(dlgBtnLoc.x , dlgBtnLoc.y); | ||
| robot.mousePress(MouseEvent.BUTTON1_DOWN_MASK); | ||
| robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); | ||
| robot.delay(500); |
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.
All the clicks above are to click a button… Should we replace these clicks with programmatic clicks?
However, I'd like to ensure the updated test still reproduces the original bug. Updating this test could better pull out into its own issue. (Yes, I remember that this refactoring comes from an internal comment I made when javax/swing/JFileChooser/bug4759934.java was open-sourced.)
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.
I'll be updating the tests in another PR.
To answer your question.
All the clicks above are to click a button… Should we replace these clicks with programmatic clicks?
I'm for keeping the other clicks as-is (via Robot) since we have reference to these buttons unlike the cancel button of JFileChooser and this way we keep much of the original test case intact without overly modifying it.
| Component result = Util.findComponent(container, | ||
| c -> c instanceof JToggleButton button | ||
| && "Details".equals(button.getToolTipText())); |
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.
| Component result = Util.findComponent(container, | |
| c -> c instanceof JToggleButton button | |
| && "Details".equals(button.getToolTipText())); | |
| Component result = Util.findComponent(container, | |
| c -> c instanceof JToggleButton button | |
| && "Details".equals(button.getToolTipText())); |
Let's not touch the indentation of the second parameter. The comment below is marked as resolved but it's not resolved. This is what I meant.
That is, only Util. is added, only one line of the findDetailsButton method changes compared to master.
This is a valid concern. I tend to agree. The test from which the This is why I suggest submitting a new bug to update Similarly, as I just mentioned, it makes sense to update |
|
@aivanov-jdk As suggested I'll be creating separate PRs for test changes. |
aivanov-jdk
left a comment
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.
Looks good to me, except for minor formatting nit.
TejeshR13
left a comment
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.
LGTM.
|
/integrate |
|
Going to push as commit 3549103.
Your commit was automatically rebased without conflicts. |
|
@honkar-jdk Pushed as commit 3549103. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
findComponent(final Container container, final Predicate<Component> predicate)is a useful utility method and thus added tojavax/swing/regtesthelpers/Util.javainstead of having redundant code in tests. It can be used to find a component by label name.PS: Existing
Util.findSubComponent()finds component by class name butfindComponent()can be used to search for a particular component by label name/title when there are multiple subcomponents of same type by applying a predicate logic.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27944/head:pull/27944$ git checkout pull/27944Update a local copy of the PR:
$ git checkout pull/27944$ git pull https://git.openjdk.org/jdk.git pull/27944/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27944View PR using the GUI difftool:
$ git pr show -t 27944Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27944.diff
Using Webrev
Link to Webrev Comment