RFR: 8304014: Convert test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java to testNG

Eirik Bjorsnos duke at openjdk.org
Wed Mar 29 09:32:35 UTC 2023


On Tue, 14 Feb 2023 17:46:21 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:

> CorruptedZipFiles could benefit from some spring cleaning and a conversion to testNG:
> 
> - The actual tests are moved into their own `@Test` methods, given more meaningful names and a Javadoc comment explaining the constraint being verified
> - The setup code is moved to a `@Before` method, slightly modernized and rewritten to take advantage of `assertEquals` 
> - `checkZipExceptionImpl` is updated to take advantage of `expectThrows`
> - A bunch of constants copied over from `ZipFile` can be deleted since JDK-6225935 has long been fixed

Hopefully this test is now easier to understand for someone who is not intimately familiar with the ZIP format. I am hearing a voice in the back of my head (Martin?) saying "this level of documentation is excessive" though. As always a trade off I guess.

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

PR Comment: https://git.openjdk.org/jdk/pull/12563#issuecomment-1447807905


More information about the core-libs-dev mailing list