RFR: 8365776: Convert JShell tests to use JUnit instead of TestNG

Christian Stein cstein at openjdk.org
Fri Sep 5 10:03:34 UTC 2025


On Tue, 19 Aug 2025 15:19:25 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> test/langtools/jdk/jshell/CommandCompletionTest.java line 94:
>> 
>>> 92:     }
>>> 93: 
>>> 94:     public void assertCompletion(String code, boolean isSmart, String... expected) {
>> 
>> Of course this is where <expected>, <actual> hits the snag of varargs being better for a list/set of expected things. It's one of the reasons I personally prefer (<actual>, <expected>), but this code needs consistency more than personal preference :)
>
> Here it is input and then expected values, not really actual value and the expected value. So the inconsistency is not that big.
> 
> I am afraid that if we move expected to front here, there will be a lot of readability lost. For me, at least. Currently (with TestNG), the code is consistent and readable. If, in order to convert to JUnit, I would have to sacrifice readability to keep consistency, then I guess I would start to question if the conversion has a point. I.e. the conversion would need to bring a benefit big enough to compensate for the loss of readability here.

In conversions like this we should not touch test-local code unrelated to the framework migration. Just keep those helpers "as-is" in order to keep the touched surface of PR small(er) and on-topic.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26841#discussion_r2285637847


More information about the compiler-dev mailing list