RFR: 7903047: Make JUnit runner use the JUnit Platform Launcher [v12]

Jonathan Gibbons jjg at openjdk.java.net
Mon Apr 25 19:31:49 UTC 2022


On Mon, 25 Apr 2022 15:52:24 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Make JUnit runner use the JUnit Platform Launcher
>> 
>> See https://bugs.openjdk.java.net/browse/CODETOOLS-7903047
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add support for `runWithJUnit4` flag

src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java line 114:

> 112:     private static void runWithJUnitPlatform(Class<?> mainClass) throws Exception {
> 113:         // https://junit.org/junit5/docs/current/user-guide/#launcher-api-execution
> 114:         Thread.currentThread().setContextClassLoader(mainClass.getClassLoader());

this line, to set the context class loader, might be an issue for some core-libs tests.

src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java line 140:

> 138:                     summary.printTo(pw);
> 139:                 }
> 140:                 System.err.println(sw);

printing to `System.err` may be an issue; this is happening on the test-side, isn't it?

test/junitTrace/JUnitTrace.gmk line 35:

> 33: 		-w:$(@:%.ok=%)/work -r:$(@:%.ok=%)/report \
> 34: 		-jdk:$(JDKHOME) \
> 35: 		-agentvm \

It might be better to upgrade this test to run in both modes (othervm, agentvm), although maybe that could be could separately

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

PR: https://git.openjdk.java.net/jtreg/pull/78


More information about the jtreg-dev mailing list