MCPcopy
hub / github.com/questdb/questdb / testCopy

Method testCopy

core/src/test/java/io/questdb/test/FilesTest.java:188–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186 }
187
188 @Test
189 public void testCopy() throws Exception {
190 assertMemoryLeak(() -> {
191 File temp = temporaryFolder.newFile();
192 TestUtils.writeStringToFile(temp, "abcde");
193 try (Path path = new Path().of(temp.getAbsolutePath())) {
194 Assert.assertTrue(Files.exists(path.$()));
195 try (Path copyPath = new Path().of(temp.getAbsolutePath()).put("-copy")) {
196 Files.copy(path.$(), copyPath.$());
197
198 Assert.assertEquals(5, Files.length(copyPath.$()));
199 TestUtils.assertFileContentsEquals(path, copyPath);
200 }
201 }
202 });
203 }
204
205 @Test
206 public void testCopyBigFile() throws Exception {

Callers

nothing calls this directly

Calls 11

writeStringToFileMethod · 0.95
existsMethod · 0.95
copyMethod · 0.95
lengthMethod · 0.95
ofMethod · 0.65
$Method · 0.65
putMethod · 0.65
assertMemoryLeakMethod · 0.45
assertTrueMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected