You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2023/01/04 19:14:12 UTC

[GitHub] [helix] xyuanlu commented on a diff in pull request #2328: Multi Implementation and Test Cases

xyuanlu commented on code in PR #2328:
URL: https://github.com/apache/helix/pull/2328#discussion_r1061805673


##########
zookeeper-api/src/test/java/org/apache/helix/zookeeper/impl/client/RealmAwareZkClientTestBase.java:
##########
@@ -67,4 +76,127 @@ public void afterClass() {
       _msdsServer.stopServer();
     }
   }
-}
+  /**
+   * Initialize requirement for testing multi support.
+   */
+  @Test
+  public void testMulti() {
+    // Create a connection config with a valid sharding key
+    RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder builder =
+            new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder();
+    RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig =
+            builder.setZkRealmShardingKey(ZK_SHARDING_KEY_PREFIX).build();
+    try {
+      _realmAwareZkClient = new FederatedZkClient(connectionConfig,
+              new RealmAwareZkClient.RealmAwareZkClientConfig());
+    } catch (IllegalArgumentException e) {
+      Assert.fail("Invalid Sharding Key.");
+    } catch (Exception e) {
+      Assert.fail("Should not see any other types of Exceptions: " + e);

Review Comment:
   If this test class is only for setting up test env, I would suggest a better name. 



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org