RFR: 8332901: Select{Current,New}ItemTest.java for Choice don't open popup on macOS [v4]

Alexey Ivanov aivanov at openjdk.org
Tue Aug 20 20:07:04 UTC 2024


On Tue, 20 Aug 2024 17:48:24 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> Ideally these two tests can be combined since they are very similar and it also means one test less to run on CI.

I believe the difference is close to negligible. Creating UI and waiting for it to be displayed likely takes more than compiling the test source code and starting a new JVM process.

> But since you are reusing the `SelectCurrentItemTest` test code and overriding the methods, this approach is cleaner and doesn't make the test complicated.

Yes, I think it's cleaner this way. Each test does one thing and tests its own scenario.

The old `SelectNewItemTest` also verified the case where the same item was selected from the popup again. Thus, it repeated what `SelectCurrentItemTest` did for a long time. So I removed it.

I found another test which tests the same scenario as `SelectNewItemTest`, it's `test/jdk/java/awt/event/ComponentEvent/ComponentItemEventTest.java`. It was added in #11786. I'm going to submit a bug to remove this scenario from the `ComponentItemEventTest` test.

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

PR Comment: https://git.openjdk.org/jdk/pull/20601#issuecomment-2299668696


More information about the client-libs-dev mailing list