shayshim commented on a change in pull request #334: [CURATOR-549] Support 
ZooKeeper 3.5.6 Persistent Recursive Watchers
URL: https://github.com/apache/curator/pull/334#discussion_r352891261
 
 

 ##########
 File path: 
curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatchesBuilder.java
 ##########
 @@ -611,6 +614,56 @@ public void pathAddedForGuaranteedOperation(
         }
     }
 
+    @Test(groups = CuratorTestBase.zk36Group)
+    public void testPersistentRecursiveWatch() throws Exception
+    {
+        try ( CuratorFramework client = 
CuratorFrameworkFactory.newClient(server.getConnectString(), new 
RetryOneTime(1)) )
+        {
+            client.start();
+            client.blockUntilConnected();
+
+            CountDownLatch latch = new CountDownLatch(5);
+            Watcher watcher = event -> latch.countDown();
+            
client.watchers().add().withMode(AddWatchMode.PERSISTENT_RECURSIVE).usingWatcher(watcher).forPath("/test");
+
+            client.create().forPath("/test");
 
 Review comment:
   Not interesting to test here also other recursive events like data changes 
and remove nodes?
   Also, might be good to create and modify recursively "/not-the-test" and 
make sure nothing comes from there.
   And remove watcher tests shouldn't be repeated for persistent/recursive too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to