MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / writeTestFile

Method writeTestFile

java/test/org/openqa/selenium/io/ZipTest.java:131–142  ·  view source on GitHub ↗
(File file)

Source from the content-addressed store, hash-verified

129 }
130
131 private void writeTestFile(File file) throws IOException {
132 File parent = file.getParentFile();
133 if (!parent.exists()) {
134 assertThat(parent.mkdirs()).isTrue();
135 }
136 byte[] byteArray = new byte[16384];
137 new Random().nextBytes(byteArray);
138 try (OutputStream out = new FileOutputStream(file)) {
139 out.write(byteArray);
140 }
141 file.deleteOnExit();
142 }
143}

Callers 3

testCanZipASingleFileMethod · 0.95
testCanZipADirectoryMethod · 0.95
writeTestZipEntryMethod · 0.95

Calls 2

existsMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected