changeset 17290:fabcc52064ee

8162902: Add some debugging output to test/java/nio/file/WatchService/DeleteInterference Summary: Add printing of iteration numbers Reviewed-by: alanb
author bpb
date Thu, 04 Aug 2016 14:29:27 -0700
parents 52e1f122bf03
children eea459e76696
files test/java/nio/file/WatchService/DeleteInterference.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/nio/file/WatchService/DeleteInterference.java	Thu Aug 04 17:49:12 2016 +0000
+++ b/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);
             }
         }
     }