RFR: 8375712: Convert java/lang/runtime tests to use JUnit [v2]

Jan Lahoda jlahoda at openjdk.org
Fri Jan 23 08:11:15 UTC 2026


On Wed, 21 Jan 2026 20:07:20 GMT, Chen Liang <liach at openjdk.org> wrote:

>> test/jdk/java/lang/runtime/SwitchBootstrapsTest.java line 161:
>> 
>>> 159:         testEnum(E1.B, 1, 3, "B", "C", "A", E1.class);
>>> 160:         assertThrows(IllegalArgumentException.class, () ->
>>> 161:             testEnum(E1.B, 0, -1, E2.class)
>> 
>> for readability it could be worth to add a helper method 
>> `testEnumError(Class<? extends RuntimeException> exceptionClass, Enum<?> target, int start, int result, Object... labels)`
>
> The `start` and `result` arguments here are completely unused.

TBH, I am not sure if that's more readable. It might be shorter, but it is one more hoop to go through when trying to understand what the test is doing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29350#discussion_r2720052217


More information about the core-libs-dev mailing list