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:11:23 GMT, Alan Bateman <alanb 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
>
> test/jdk/tools/jmod/hashes/HashesTest.java line 94:
> 
>> 92:         lib= null;
>> 93:         builder=null;
>> 94:     }
> 
> This looks like a workaround. Can you instead see if the fields can be changed to non-final and place the constructor with a method that has the `@BeforeClass` annotation?

I can look to update the test.  As I mentioned in my reply to Chris, I had thought about introducing an inner class bug decided to go the route of the default/no-arg constructor as it required fewer changes.

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

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


More information about the core-libs-dev mailing list