> Create an automated test for > [JDK-4170173](https://bugs.openjdk.java.net/browse/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](https://bugs.openjdk.java.net/browse/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.
Srinivas Mandalika has updated the pull request incrementally with one additional commit since the last revision: Review Comments Fixed: Simplied test ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/8138/files - new: https://git.openjdk.java.net/jdk/pull/8138/files/0d7673fb..d4c97f68 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8138&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8138&range=00-01 Stats: 159 lines in 2 files changed: 48 ins; 44 del; 67 mod Patch: https://git.openjdk.java.net/jdk/pull/8138.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/8138/head:pull/8138 PR: https://git.openjdk.java.net/jdk/pull/8138