RFR 8230870: Add a ZIP FS test that is similar to test/jdk/java/util/zip/EntryCount64k.java

Martin Buchholz martinrb at google.com
Mon Sep 16 14:08:24 UTC 2019


On Mon, Sep 16, 2019 at 6:43 AM Martin Buchholz <martinrb at google.com> wrote:

> Thanks for doing this.
> Looks Good To Me, but as always I have some comments
>
> EntryCount64k was written before testng infrastructure was common.  I
> might have done some surgery on EntryCount64k to accommodate zipfs instead
> of writing an entirely new test.  zipfs adds to the number of ways that zip
> files can be written - I generally only thought about ZipOutputStream.  One
> can structure zip tests using front-end/back-end strategy:  Combine N ways
> to write a zip file with M ways to read it, and verify that they all work
> together.  But we've never written tests that way.
>
> Stop using System.currentTimeMillis for measuring elapsed time, and switch
> to System.nanoTime.  Hmmm .... probably even better here is to hop over
> nanoTime to using java.time APIs like Duration.between as in
> https://www.baeldung.com/java-measure-elapsed-time section 3.2
>

Hmmmmmmmm ..............  Wait, it looks like Instant/Duration are also
tied to wall clock time. Is it really true that java.time doesn't offer any
simple elapsed time utility like e.g. Guava or Apache Stopwatch?!  I guess
I'll stick to nanoTime in my own tests...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190916/2548f09e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190916/2548f09e/oracle_sig_logo.gif>


More information about the nio-dev mailing list