On Wed, 21 Jan 2026 16:32:06 GMT, Jan Lahoda <[email protected]> wrote:

> This PR converts the tests under `test/jdk/java/lang/runtime/` to use JUnit. 
> Mostly converted by the automatic conversion tool, but there's a manual tweak 
> to use `assertThrows` instead of the current manual `try-catch`. Also one 
> manual fix. The changes are in separate commits, which should help reviewing.
> 
> Thanks!

test/jdk/java/lang/runtime/ExactnessConversionsSupportTest.java line 52:

> 50: public class ExactnessConversionsSupportTest {
> 51: 
> 52:     public void main(String[] args) {

Let's remove this main method altogether.

test/jdk/java/lang/runtime/SwitchBootstrapsTest.java line 38:

> 36: import java.lang.classfile.ClassFile;
> 37: 
> 38: import org.junit.jupiter.api.Assertions;

Let's use static imports and remove this import.

test/jdk/java/lang/runtime/SwitchBootstrapsTest.java line 407:

> 405:     @Test
> 406:     public void testNullLookup() throws Throwable {
> 407:         Assertions.assertThrows(NullPointerException.class, () -> {

Can use the static import version instead of fully qualifying here

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29350#discussion_r2714076232
PR Review Comment: https://git.openjdk.org/jdk/pull/29350#discussion_r2714088718
PR Review Comment: https://git.openjdk.org/jdk/pull/29350#discussion_r2714087494

Reply via email to