RFR: 7903047: Make JUnit runner use the JUnit Platform Launcher [v12]
Christian Stein
cstein at openjdk.java.net
Thu Apr 28 13:48:05 UTC 2022
On Mon, 25 Apr 2022 19:19:41 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> 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 46:
>
>> 44: public class JUnitRunner implements MainActionHelper.TestRunner {
>> 45: private static final String
>> 46: JUNIT_NO_DRIVER = "No JUnit driver (install junit-platform-console-standalone.jar next to jtreg.jar)";
>
> The code should not specifically require this jar file by name. We went to an effort recently to decouple the names of the jar files used to build jtreg from the code that uses them.
> Admittedly, this string literal was an accidental oversight from that recent work. I suggest changing the name of the jar file to just `JUnit` or `JUnit jar file(s)`
Changed to `JUnit JAR file(s)`.
> src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java line 48:
>
>> 46: JUNIT_NO_DRIVER = "No JUnit driver (install junit-platform-console-standalone.jar next to jtreg.jar)";
>> 47: private static final boolean
>> 48: JUNIT_RUN_WITH_JUNIT_4 = Flags.get("runWithJUnit4");
>
> suggest adding comment that this is temporary, during the transition.
Comment added.
> 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?
It's doing the same as the JUnit 4 runner already did before. Thus, it shouldn't introduce new issues.
> 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
I agree — should be done in separate PR to keep the changes of this PR focussed around making the JUnit Platform Launcher work.
-------------
PR: https://git.openjdk.java.net/jtreg/pull/78
More information about the jtreg-dev
mailing list