--- old/test/jdk/jdk/nio/zipfs/ZipFSTester.java 2018-09-18 17:11:26.318530931 -0700 +++ new/test/jdk/jdk/nio/zipfs/ZipFSTester.java 2018-09-18 17:11:25.934496024 -0700 @@ -73,7 +73,7 @@ * @test * @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596 * 7157656 8002390 7012868 7012856 8015728 8038500 8040059 8069211 - * 8131067 8034802 + * 8131067 8034802 8210899 * @summary Test Zip filesystem provider * @modules jdk.zipfs * @run main ZipFSTester @@ -95,7 +95,6 @@ test1(fs); test2(fs); // more tests } - testStreamChannel(); testTime(jarFile); test8069211(); @@ -434,6 +433,28 @@ // check the content of read from zipfs is equal to the "bytes" private static void checkRead(Path path, byte[] expected) throws IOException { + + // fileAttribute + CRC32 crc32 = new CRC32(); + crc32.update(expected); + + if (((Long)Files.getAttribute(path, "zip:crc")).intValue() != + (int)crc32.getValue()) { + System.out.printf(" getAttribute.crc <%s> failed %x vs %x ...%n", + path.toString(), + ((Long)Files.getAttribute(path, "zip:crc")).intValue(), + (int)crc32.getValue()); + throw new RuntimeException("CHECK FAILED!"); + } + + if (((Long)Files.getAttribute(path, "zip:size")).intValue() != expected.length) { + System.out.printf(" getAttribute.size <%s> failed %x vs %x ...%n", + path.toString(), + ((Long)Files.getAttribute(path, "zip:size")).intValue(), + expected.length); + throw new RuntimeException("CHECK FAILED!"); + } + //streams try (InputStream is = Files.newInputStream(path)) { if (!Arrays.equals(is.readAllBytes(), expected)) {