MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / testCanUnzip

Method testCanUnzip

java/test/org/openqa/selenium/io/ZipTest.java:95–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93 }
94
95 @Test
96 void testCanUnzip() throws IOException {
97 File testZip = File.createTempFile("testUnzip", "zip");
98 writeTestZip(testZip, 5, 10_000L);
99 File out = Zip.unzipToTempDir(new FileInputStream(testZip), "unzip", "stream");
100 assertThat(out.list()).hasSize(5);
101
102 assertThat(Arrays.stream(out.listFiles()).map(File::lastModified).collect(toSet()))
103 .as("Preserves original file's modification time when unzipping")
104 .containsExactlyInAnyOrder(0L, 10_000L, 20_000L, 30_000L, 40_000L);
105 }
106
107 private void writeTestZip(File file, int files, long lastModifiedStep) throws IOException {
108 try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(file))) {

Callers

nothing calls this directly

Calls 6

writeTestZipMethod · 0.95
unzipToTempDirMethod · 0.95
createTempFileMethod · 0.80
listMethod · 0.65
mapMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected