RFR: 8296283: JUnit5 tests using Params API fails to compile [v2]

Kevin Rushforth kcr at openjdk.org
Mon Nov 7 17:13:42 UTC 2022


On Mon, 7 Nov 2022 16:29:42 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> This issue was uncovered when running the test added in PR: https://github.com/openjdk/jfx/pull/910
>> The JUnit5 tests using Params API fails to compile.
>> 
>> Fix:
>> Change dependency of `junit-jupiter-params` from runtime to compile time.
>> From: https://junit.org/junit5/docs/current/user-guide/#overview-what-is-junit-5: it can be understood that packages of JUnit Jupiter other than `TestEngine` are required for test compilation and
>> JUnit Platform serves as a foundation for [launching testing frameworks](https://junit.org/junit5/docs/current/user-guide/#launcher-api)
>> 
>> It seems that changing dependency of this one package is sufficient for this fix.
>
> Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add test

The test looks good. I left a couple minor comments.

modules/javafx.base/src/test/java/test/JUnit5Test.java line 49:

> 47:     static int callCount;
> 48:     static int[] intValues = {1, 2, 3};
> 49:     @ValueSource(ints = {1, 2, 3})

Minor: maybe add a blank line before this line?

modules/javafx.base/src/test/java/test/JUnit5Test.java line 68:

> 66:                 if (i != 0) {
> 67:                     fail("Test method not called for Value " + i);
> 68:                 }

Minor: could simplify this to:


    assertEquals(0, i, "Test method not called for Value " + i);

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

Marked as reviewed by kcr (Lead).

PR: https://git.openjdk.org/jfx/pull/939


More information about the openjfx-dev mailing list