On Tue, 20 Aug 2024 17:48:24 GMT, Harshitha Onkar <hon...@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

Reply via email to