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

8284077: Create an automated test for JDK-4170173 #8138

Closed
wants to merge 3 commits into from

Conversation

srmandal
Copy link

@srmandal srmandal commented Apr 7, 2022

Create an automated test for JDK-4170173

Issue
JTextComponent.AccessibleJTextComponent.getAfterIndex(int part, int index) works incorrectly, when 'part' parameter is AccessibleText.WORD.
It returns a space (" ") instead of the correct word.

The test verifies the fix for this behavior by checking the getAfterIndex for AccessibleText.CHARACTER,AccessibleText.WORD,AccessibleText.SENTENCE for the components JTextField, JTextArea, JEditorPane.

While working on this test case there was a related bug relevant to this JDK-4170174
This is marked as duplicate, addressess a similar issue.
It indicates that JTextComponent.AccessibleJTextComponent.getBeforeIndex(int part, int index) works incorrectly, when part parameter is AccessibleText.WORD.
It returns a space (" ") instead of correct word.

Hence an additional test was added for this, for verifying the behavior of getBeforeIndex.
AccessibleText.CHARACTER,AccessibleText.WORD,AccessibleText.SENTENCE for the components JTextField, JTextArea, JEditorPane.

The two tests have multiple distinct assertions. For this reason, as well as for maintainability, the two were not clubbed into a single test.
However, the two tests are still similar in the functional flow of the code and the functionality they are testing as well - hence they have been clubbed into a single review.
This review is for migrating tests from a closed test suite to open.

Testing:
The tests ran successfully on Mach5 with multiple runs (30) on windows-x64, linux-x64 and macos-x64.


Progress

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

Issue

  • JDK-8284077: Create an automated test for JDK-4170173

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8138

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 7, 2022

👋 Welcome back smandalika! 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 Apr 7, 2022

@srmandal 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 Apr 7, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 7, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 7, 2022

Webrevs

@srmandal
Copy link
Author

@mrserb can you please review the changes after I have incorporated the earlier feedback ?

@openjdk
Copy link

openjdk bot commented Apr 27, 2022

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

8284077: Create an automated test for JDK-4170173

Reviewed-by: serb

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 237 new commits pushed to the master branch:

  • 72f82dd: 8208565: [TEST_BUG] javax\swing\PopupFactory\6276087\NonOpaquePopupMenuTest.java throws NPE
  • 4714fdc: 8285279: ArgumentsTest.set_numeric_flag_double_vm fails on some locales (again)
  • cc89f1b: 8198622: java/awt/Focus/TypeAhead/TestFocusFreeze.java fails on mac
  • d3ea4b7: 8283435: AArch64: [vectorapi] Optimize SVE lane/withLane operations for 64/128-bit vector sizes
  • 16ebe40: 8251177: [macosx] The text "big" is truncated in JTabbedPane
  • e574cc0: 8196367: java/awt/List/SingleModeDeselect/SingleModeDeselect.java times out
  • 14e7d91: 8285404: RSA signature verification should reject non-DER OCTET STRING
  • 110edd9: 8284965: closed test sun/java2d/OpenGL/XORPaint.java is unstable
  • dbcf389: 8198666: Many java/awt/Modal/OnTop/ test fails on mac
  • 102a305: 8202790: DnD test DisposeFrameOnDragTest.java does not clean up
  • ... and 227 more: https://git.openjdk.java.net/jdk/compare/61fcf2f67ff16bee92a5279e7bcacc79fc8f37ad...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) 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 27, 2022
@srmandal
Copy link
Author

/integrate

@srmandal
Copy link
Author

@mrserb Can you please sponsor this PR?

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

openjdk bot commented Apr 27, 2022

@srmandal
Your change (at version d4c97f6) is now ready to be sponsored by a Committer.

@prrace
Copy link
Contributor

prrace commented Apr 27, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 27, 2022

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

  • a0b984a: 8282933: Create a test for JDK-4529616
  • 716a80a: 8283179: SA tests fail with "ERROR: catch_mach_exception_raise: Message doesn't denote a Unix soft signal."
  • 6c79671: 8285633: Take better advantage of generic MethodType cache
  • 5b42747: 8285736: JDK-8236128 causes validate-source failures
  • 6ce4e75: 8284726: Print active locale settings in hs_err reports and in VM.info
  • b675c59: 8236128: Allow jpackage create installers for services
  • ef27081: 8285671: java/nio/channels/etc/PrintSupportedOptions.java and java/nio/channels/DatagramChannel/AfterDisconnect.java are failing
  • 4919525: 8285440: Typo in Collections.addAll method javadoc
  • e7c3b9d: 8285617: Fix java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java manual test
  • 16a8ebb: 8285675: Temporary fix for arm32 SafeFetch
  • ... and 237 more: https://git.openjdk.java.net/jdk/compare/61fcf2f67ff16bee92a5279e7bcacc79fc8f37ad...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 27, 2022
@openjdk openjdk bot closed this Apr 27, 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 27, 2022
@openjdk
Copy link

openjdk bot commented Apr 27, 2022

@prrace @srmandal Pushed as commit 6db2e16.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@srmandal srmandal deleted the 8284077 branch October 20, 2022 06:43
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.

3 participants