RFR: 8350880: (zipfs) Add support for read-only zip file systems [v3]

David Beaumont duke at openjdk.org
Thu May 15 17:54:54 UTC 2025


On Wed, 14 May 2025 17:04:01 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix comment based on current behaviour.
>
> test/jdk/jdk/nio/zipfs/NewFileSystemTests.java line 207:
> 
>> 205:                         Map.of("create", true, "accessMode", "badValue")));
>> 206:     }
>> 207: 
> 
> You could simplify the above tests using a DataProvider similar to
> 
> @DataProvider(name = "zipfsMap")
> protected Object[][] zipfsMap() {
>     return new Object[][]{
>             {Map.of(), NoSuchFileException.class},
>             {Map.of("accessMode", "readOnly"), NoSuchFileException.class},
>             {Map.of("accessMode", "readWrite"),  NoSuchFileException.class},
>             {Map.of("create", true, "accessMode", "readOnly"),  IllegalArgumentException.class},
>             {Map.of("create", true, "accessMode", "badValue"),  IllegalArgumentException.class},
>     };
> @Test(dataProvider = "zipfsMap”)
> public void testZipFSCreationException(Map<String, String> env, Class<T> exception) throws Exception {
>        assertThrows(exception, () -> FileSystems.newFileSystem(noSuchZip, env));
> }

Done. Thanks for giving the example, it really helped.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25178#discussion_r2091698261


More information about the core-libs-dev mailing list