RFR: 8304014: Convert test/jdk/java/util/zip/ZipFile/CorruptedZipFiles.java to junit [v5]

Eirik Bjorsnos duke at openjdk.org
Fri Mar 31 13:51:22 UTC 2023


> 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

Eirik Bjorsnos has updated the pull request incrementally with four additional commits since the last revision:

 - Document the structure of the 'good' ZIP
 - Use the "Validate that.." comment style
 - Document the ByteBuffer with a comment
 - Use ByteBuffer when manipulating multi-byte fields

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12563/files
  - new: https://git.openjdk.org/jdk/pull/12563/files/01c25e84..e32052f1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12563&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12563&range=03-04

  Stats: 113 lines in 1 file changed: 74 ins; 5 del; 34 mod
  Patch: https://git.openjdk.org/jdk/pull/12563.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/12563/head:pull/12563

PR: https://git.openjdk.org/jdk/pull/12563


More information about the core-libs-dev mailing list