RFR: 8266461: tools/jmod/hashes/HashesTest.java fails: static @Test methods

Lance Andersen lancea at openjdk.java.net
Thu May 13 14:52:54 UTC 2021


On Thu, 13 May 2021 11:24:34 GMT, Chris Hegarty <chegar at openjdk.org> wrote:

> 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.

I had originally thought about introducing an inner class but decided that given TestNG needs access to  the default constructor, I chose that route vs. doing more of an update.  I can revisit this though

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

PR: https://git.openjdk.java.net/jdk/pull/4009


More information about the core-libs-dev mailing list