RFR: JDK-8282046: Create a regression test for JDK-8000326 [v3]

Srinivas Mandalika smandalika at openjdk.java.net
Thu Mar 17 07:20:32 UTC 2022


On Fri, 11 Mar 2022 14:38:28 GMT, Srinivas Mandalika <smandalika at openjdk.org> wrote:

>> Create a regression test for CCC8000326
>> 
>> Issue is identified by [JDK-8000326](https://bugs.openjdk.java.net/browse/JDK-8000326), which identifies that after focus moves into JMenuBar, whose focus traversal key is disabled by default, it never moves to other focusable component.
>>  
>> By default, pressing the Tab key does not transfer focus from a JMenuBar which is added to a container together with other Swing components, because the focusTraversalKeysEnabled property of JMenuBar is set to false. To resolve this, you should call the JMenuBar.setFocusTraversalKeysEnabled(true) method.
>>  
>> The test verifies focus traversal for the above described scenario.
>> This review is for migrating tests from a closed test suite to open.
>
> Srinivas Mandalika has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Added @bug keyword

>
As indicated by the comment [here](https://bugs..openjdk.java.net/browse/JDK-8000326?focusedCommentId=13291129&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13291129) in bug [JDK-8000326](https://bugs.openjdk.java.net/browse/JDK-8000326), the fix in 8-b78 was made not in code but in the docs, to clarify that the failure in focus traversal from Menu Bar to the other components was due to the default false value set to jMenuBar's focusTraversalKeysEnabled and is as expected.

The test is to ensure that with jMenuBar.setFocusTraversalKeysEnabled(true), <Line no 82 in Test> the focus traversal across the components of the the UI is successful.

The test fails in jdk8-b77, jdk8-b78, as well as in latest JDK8u builds with  jMenuBar.setFocusTraversalKeysEnabled(**false**)
The test passes in jdk8-b77, jdk8-b78, as well as in latest JDK8u builds with  jMenuBar.setFocusTraversalKeysEnabled(**true**)
This is the expected behavior.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7512



More information about the client-libs-dev mailing list