# HG changeset patch # User bpb # Date 1470346167 25200 # Node ID 673d89604418927c7c0413b79953da0d444b07c6 # Parent 4f81380d441a4d807b500c81bd68a031abebd30a 8162902: Add some debugging output to test/java/nio/file/WatchService/DeleteInterference Summary: Add printing of iteration numbers Reviewed-by: alanb diff -r 4f81380d441a -r 673d89604418 jdk/test/java/nio/file/WatchService/DeleteInterference.java --- a/jdk/test/java/nio/file/WatchService/DeleteInterference.java Thu Aug 04 17:49:12 2016 +0000 +++ b/jdk/test/java/nio/file/WatchService/DeleteInterference.java Thu Aug 04 14:29:27 2016 -0700 @@ -38,6 +38,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; +import static java.lang.System.out; import static java.nio.file.StandardWatchEventKinds.*; public class DeleteInterference { @@ -66,22 +67,28 @@ private static void openAndCloseWatcher(Path dir) { FileSystem fs = FileSystems.getDefault(); for (int i = 0; i < ITERATIONS_COUNT; i++) { + out.printf("open %d begin%n", i); try (WatchService watcher = fs.newWatchService()) { dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); } catch (IOException ioe) { // ignore + } finally { + out.printf("open %d end%n", i); } } } private static void deleteAndRecreateDirectory(Path dir) { for (int i = 0; i < ITERATIONS_COUNT; i++) { + out.printf("del %d begin%n", i); try { deleteFileTree(dir); Path subdir = Files.createDirectories(dir.resolve("subdir")); Files.createFile(subdir.resolve("test")); } catch (IOException ioe) { // ignore + } finally { + out.printf("del %d end%n", i); } } }