RFR: 8305945: (zipfs) Opening a directory to get input stream produces incorrect exception message [v5]

Eirik Bjorsnos duke at openjdk.org
Mon Apr 17 17:31:41 UTC 2023


On Mon, 17 Apr 2023 17:04:32 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> What you have is fine, I'm just making the point that the exception message is somewhat secondary

I guess this is also a question of testing the interface vs. testing the implementation.

To get good coverage of validation scenarios, I often find it quite useful to test on the actual message. This makes the test overspecific to the interface, but it helps make sure that each error condition is covered independently. Without asserting on the actual message, it can be hard to know if you are being shadowed by another higher level error condition. I've seen this a lot when adding test coverage for various ZIP processing code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13482#discussion_r1169058586


More information about the nio-dev mailing list