RFR: 8327980: Convert javax/swing/JToggleButton/4128979/bug4128979.java applet test to main [v2]

Harshitha Onkar honkar at openjdk.org
Mon Mar 18 17:33:28 UTC 2024


On Thu, 14 Mar 2024 17:59:04 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>> test/jdk/javax/swing/JToggleButton/bug4128979.java line 69:
>> 
>>> 67: 
>>> 68:     public static void main(String[] args) throws Exception {
>>> 69:         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
>> 
>> As the test is for Windows only it is good to have OS check along with the `@requires (os.family == "windows")` and throw skipped exception otherwise.
>> 
>> Since it is followed by setting `WindowsClassicLookAndFeel` all the more reason to include this check.
>> 
>> Suggestion:
>> 
>>          if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
>>             throw new SkippedException("This test is for Windows only");
>>         }
>>         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
>
> Updated.

You can remove the OS check here if you would like to, since it is not strictly required when run as jtreg test (which is essentially the case here).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18233#discussion_r1528981229


More information about the client-libs-dev mailing list