xyuanlu commented on code in PR #2465:
URL: https://github.com/apache/helix/pull/2465#discussion_r1181766399
##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/TestZooKeeperConnection.java:
##########
@@ -0,0 +1,69 @@
+package org.apache.helix.zookeeper.impl;
+
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.helix.zookeeper.zkclient.IZkConnection;
+import org.apache.helix.zookeeper.zkclient.ZkClient;
+import org.apache.zookeeper.AddWatchMode;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.ZooDefs;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+
+public class TestZooKeeperConnection extends ZkTestBase {
+ final int count = 100;
+ final int[] get_count = {0};
+ CountDownLatch countDownLatch = new CountDownLatch(count*2);
+
+
+ /*
+ This function tests persist watchers' behavior in {@link
org.apache.helix.zookeeper.zkclient.ZkConnection}
+ 1. Register a persist watcher on a path and create 100 children Znode, edit
the ZNode for 100 times.
+ Expecting 200 events.
+ 2. register a one time listener on the path. Make the same change and count
the total number of event.
Review Comment:
Subscribing one-time listener using Helix/ZkClient will throw exception.
This test checks our simple wrapper of native Zk client (ZkConnection) and
verify persist/one time behavior.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]