rabashizade commented on code in PR #2090:
URL: https://github.com/apache/helix/pull/2090#discussion_r875251089
##########
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:
I added calls with the API that writes data to ZK as well. I think the rest
of the new methods get called internally by calling these higher-level API. If
this doesn't satisfy your concern, please let me know so I call them explicitly.
--
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]