RFR: 8266461: tools/jmod/hashes/HashesTest.java fails: static @Test methods
Chris Hegarty
chegar at openjdk.java.net
Thu May 13 11:27:00 UTC 2021
On Thu, 13 May 2021 10:49:21 GMT, Lance Andersen <lancea at openjdk.org> wrote:
> HI all,
>
> Please review the fix to HashesTest.java to support running on TestNG 7.4.
>
> The fix adds a no-arg constructor which TestNG requires.
>
> The change allows the test to run with the current jtreg as well as the upcoming jtreg
>
>
> Best
> Lance
The non-static state in this test class is initialized for each of the static testXXX scenarios. An alternative could be to move said state (four fields) into a static inner class, and have each of the testXXX scenarios create an instance of that class with the test-specific path. That would also allow the addition of the no-args public constructor to HashesTest, and the testXXX methods to be made non-static.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4009
More information about the core-libs-dev
mailing list