RFR: 8295774 : Write a test to verify that List Item selection events. [v2]

Alexey Ivanov aivanov at openjdk.org
Wed Nov 2 11:20:27 UTC 2022


On Wed, 2 Nov 2022 04:04:14 GMT, ravi gupta <duke at openjdk.org> wrote:

>> This testcase verify that List Item selection via mouse/keys generates ItemEvent/ActionEvent appropriately.
>> 
>> a. Single click on the list generate ItemEvent and double click on item generates ActionEvent.
>> b. UP/DOWN keys on the list generate ItemEvent and enter key on item generates ActionEvent.
>> 
>> Testing:
>> Tested using Mach5(20 times per platform) in macos,linux and windows and got all pass.
>
> ravi gupta has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8295774 : Write a test to verify that List Item selection events.

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 80:

> 78:         robot = new Robot();
> 79:         try {
> 80: 

I think this blank line in unnecessary.

test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 89:

> 87:             Point listAt = list.getLocationOnScreen();
> 88: 
> 89:             Dimension listDimension = list.getSize();

Would `size` or `listSize` be a better name?

I think the blank line between `listAt` and `listDimension` is not necessary, such as the one below before the `Robot.move` call.

test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 118:

> 116:             EventQueue.invokeAndWait(() -> list.select(0));
> 117: 
> 118:             if (itemStateChanged) {

You may add `Robot.waitForIdle` to be 100% sure; even though the selection occurs on the EDT, by the time `invokeAndWait` returns the listeners will have been notified. So, it should be pretty safe without it.

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

PR: https://git.openjdk.org/jdk/pull/10899



More information about the client-libs-dev mailing list