8162902: Add some debugging output to test/java/nio/file/WatchService/DeleteInterference
authorbpb
Thu, 04 Aug 2016 14:29:27 -0700
changeset 40123 673d89604418
parent 40122 4f81380d441a
child 40124 01f8745abd3c
8162902: Add some debugging output to test/java/nio/file/WatchService/DeleteInterference Summary: Add printing of iteration numbers Reviewed-by: alanb
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);
             }
         }
     }