rabashizade commented on code in PR #2090:
URL: https://github.com/apache/helix/pull/2090#discussion_r875269821


##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/TestRawZkClient.java:
##########
@@ -89,6 +89,65 @@ public void afterClass() {
     _zkClient.close();
   }
 
+  @Test
+  void testUnimplementedTypes() {
+    System.clearProperty("zookeeper.extendedTypesEnabled");
+    String parentPath = "/tmp";
+    String path = "/tmp/unimplemented";
+    long ttl = 1L;
+    _zkClient.deleteRecursively(parentPath);
+    try {
+      _zkClient.createPersistentWithTTL(path, true, ttl);
+    } catch (ZkException e) {
+      AssertJUnit.assertTrue(e.getCause() instanceof 
KeeperException.UnimplementedException);
+      return;
+    }
+    _zkClient.deleteRecursively(parentPath);
+    AssertJUnit.fail();
+  }
+
+  @Test
+  void testCreatePersistentWithTTL() {
+    System.setProperty("zookeeper.extendedTypesEnabled", "true");
+    String parentPath = "/tmp";
+    String path = "/tmp/createTTL";
+    _zkClient.deleteRecursively(parentPath);
+    AssertJUnit.assertFalse(_zkClient.exists(path));
+    long ttl = 1L;
+    _zkClient.createPersistentWithTTL(path, true, ttl);
+    AssertJUnit.assertTrue(_zkClient.exists(path));
+    _zkClient.deleteRecursively(parentPath);
+    System.clearProperty("zookeeper.extendedTypesEnabled");
+  }
+
+  @Test
+  void testCreatePersistentSequentialWithTTL() {
+    System.setProperty("zookeeper.extendedTypesEnabled", "true");
+    String parentPath = "/tmp";
+    String path = "/tmp/createSequentialTTL";
+    _zkClient.deleteRecursively(parentPath);
+    AssertJUnit.assertFalse(_zkClient.exists(path + "0000000000"));
+    long ttl = 1L;
+    _zkClient.createPersistent(parentPath);
+    _zkClient.createPersistentSequentialWithTTL(path, null, ttl);
+    AssertJUnit.assertTrue(_zkClient.exists(path + "0000000000"));
+    _zkClient.deleteRecursively(parentPath);
+    System.clearProperty("zookeeper.extendedTypesEnabled");
+  }
+
+  @Test
+  void testCreateContainer() {
+    System.setProperty("zookeeper.extendedTypesEnabled", "true");
+    String parentPath = "/tmp";
+    String path = "/tmp/createContainer";
+    _zkClient.deleteRecursively(parentPath);
+    AssertJUnit.assertFalse(_zkClient.exists(path));
+    _zkClient.createContainer(path, true);

Review Comment:
   @mgao0 I had just added some more tests before your comment, is your comment 
considering those tests as well?



-- 
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]

Reply via email to