RFR: 8281738: Create a regression test for checking the 'Space' key activation of focused Button [v2]

Jayathirth D V jdv at openjdk.java.net
Thu Feb 17 11:23:07 UTC 2022


On Thu, 17 Feb 2022 02:12:01 GMT, Manukumar V S <mvs at openjdk.org> wrote:

>> test/jdk/javax/swing/JButton/SpaceKeyActivatesButton.java line 39:
>> 
>>> 37: 
>>> 38: /*
>>> 39:  * @test
>> 
>> @bug ?
>> 
>> And I presume you've verified this using mach 5?
>> 
>> Also do we actually specify that Space generates an ActionEvent on a Button ?
>> I'm wondering what is the motivation for this test.
>
> I couldn't find any bug associated with this, that's why @bug label was not given. I had created a test for [JDK-4659800](https://bugs.openjdk.java.net/browse/JDK-4659800) -> https://git.openjdk.java.net/jdk/pull/7296 which verifies the action of 'Enter' key on focused button, but it was applicable for Windows platform(Windows and Windows Classic LnFs) only. So just thought of creating a test which is applicable for all platforms and in all LnFs. This doc https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/event/ActionEvent.html says that "To invoke an ActionEvent on a Button using the keyboard, use the Space bar", so I created a general test which checks this fact as I couldn't find any existing test related to this use case.
> This is well tested using mach5 and the link is attached in the bug.

@bug is informational tag and it is not necessary to have product bug to map it. It will help in tracking why this test case was added(especially now when we no more use JBS bug id in test case names).

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

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



More information about the client-libs-dev mailing list