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

Eirik Bjorsnos duke at openjdk.org
Fri Mar 31 14:01:21 UTC 2023


On Fri, 31 Mar 2023 13:51:22 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:

>> CorruptedZipFiles could benefit from some spring cleaning and a conversion to junit:
>> 
>> - 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 `assertThrows`
>> - 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

@Martin-Buchholz this PR suggests we can improve the `CorruptedZipFiles` test.

Would be interested in hearing if you agree this is an improvement? If not, why?

Thanks!

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

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


More information about the core-libs-dev mailing list