RFR: 8340007: Refactor KeyEvent/FunctionKeyTest.java

Alexander Zvegintsev azvegint at openjdk.org
Tue Sep 17 07:50:06 UTC 2024


On Mon, 16 Sep 2024 09:55:19 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> This changeset refactors `java/awt/event/KeyEvent/FunctionKeyTest.java`.
> 
> Key changes:
> 
> - Use `CyclicBarrier` to verify whether a key is pressed and released;
> - Use `CountDownLatch` for frame activation;
> - Ensure thread-safety for keeping thrown exceptions.
> 
> Other changes:
> 
> - Made `FunctionKeyTester` a nested class inside `FunctionKeyTest`;
> - Used constants for the key events rather than magic numbers.
> 
> I ran the updated test a few times with `JTREG=REPEAT_COUNT=20`, the test has passed.
> 
> The updated test executes somewhat quicker than the old one.
> 
> @azvegint, you may want to take a look.

Marked as reviewed by azvegint (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/21013#pullrequestreview-2308671159


More information about the client-libs-dev mailing list