RFR: 8366678: Use JUnit in test/langtools/tools/javac [v2]

Chen Liang liach at openjdk.org
Thu Sep 4 14:26:47 UTC 2025


On Thu, 4 Sep 2025 05:58:55 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/javac/FDTest.java line 210:
>> 
>>> 208: }
>>> 209: 
>>> 210: class LocalTestInstanceFactory implements TestInstanceFactory {
>> 
>> Since we have this again, can we just make a no-arg-constructor calling test instance factory and leave it in like /test/lib?
>
> We either help Jupiter to select the right constructor or rewrite the test class to have a single one.
> 
> An alternative implemented in a future Jupiter version could be to ignore `private` constructors. On the other hand, having the need and ability to create "detached" test instances, not managed by Jupiter, is very uncommon. As those detached instances won't take part in Jupiter's test instance lifecycle: https://docs.junit.org/current/user-guide/#writing-tests-test-instance-lifecycle

Well, uncommon as it is claimed to be, it already appeared twice in the set of tests in javac 😕

>> test/langtools/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java line 25:
>> 
>>> 23: 
>>> 24: // this test has been disabled because of timeout issues.
>>> 25: // see JDK-8006746
>> 
>> Should we convert this to a full jtreg header and use problem lists or `@ignore` directive instead?
>
> I didn't find `JDK-8006746` nor `8006746` in no other file — that's why I decided to dispose (against the goal of this PR to not clean up...) that comment.

@vicente-romero-oracle Since you originally handled this test, can you decide what we should do with this?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2322379163
PR Review Comment: https://git.openjdk.org/jdk/pull/27046#discussion_r2322371905


More information about the compiler-dev mailing list