index 8ba047bb5c3..d457f2820a6 100644 --- a/test/lib-test/jdk/test/lib/FileUtilsTest.java +++ b/test/lib-test/jdk/test/lib/FileUtilsTest.java @@ -37,6 +37,8 @@ public class FileUtilsTest { public static void main(String[] args) throws Exception { + testCopyDirectoryToPWD(); + // Replace with same line test("a", 1, 1, null, "a", "a\n"); // Replace with different line @@ -121,4 +123,15 @@ private static void test(String content, int from, int to, String replace, } Asserts.assertEQ(output, (expected != null) ? expected.replaceAll("\n", System.lineSeparator()) : null); } -} \ No newline at end of file + + private static void testCopyDirectoryToPWD() throws Exception { + String dir = System.getProperty("test.classes"); + System.out.println("copyDirectory(\"" + dir + "\", \".\")"); + + Path src = Paths.get(dir); + Path dst = Paths.get(System.getProperty("user.dir")); + FileUtils.copyDirectory(src, dst); + + Files.writeString(Paths.get("file2.txt"), "Hello"); + } +}