kaisun2000 commented on a change in pull request #1227:
URL: https://github.com/apache/helix/pull/1227#discussion_r508915459



##########
File path: helix-core/src/test/java/org/apache/helix/tools/TestClusterSetup.java
##########
@@ -61,56 +61,162 @@
   protected static final String STATE_MODEL = "MasterSlave";
   protected static final String TEST_NODE = "testnode_1";
 
-  private ClusterSetup _clusterSetup;
+  private ClusterSetup _clusterSetup = null;
 
   private static String[] createArgs(String str) {
     String[] split = str.split("[ ]+");
     System.out.println(Arrays.toString(split));
     return split;
   }
 
-  @BeforeClass()
+  @BeforeClass
   public void beforeClass() throws Exception {
     System.out
         .println("START TestClusterSetup.beforeClass() " + new 
Date(System.currentTimeMillis()));
+    _clusterSetup = new ClusterSetup(ZK_ADDR);
   }
 
-  @AfterClass()
+  @AfterClass
   public void afterClass() {
+    String testClassName = this.getShortClassName();
+    System.out.println("AfterClass: " + testClassName + " of TestClusterSetup 
called.");
+
     deleteCluster(CLUSTER_NAME);
+    _clusterSetup.close();
     System.out.println("END TestClusterSetup.afterClass() " + new 
Date(System.currentTimeMillis()));
   }
 
-  @BeforeMethod()
+  @BeforeMethod
   public void setup() {
+    // System.out.println("@BeforeMethod TestClusterSetup beforeMethod called. 
");
+    try {
+      _gZkClient.deleteRecursively("/" + CLUSTER_NAME);
+      _clusterSetup.addCluster(CLUSTER_NAME, true);
+    } catch (Exception e) {
+      System.out.println("@BeforeMethod TestClusterSetup exception:" + e);
+    }
+  }
 
-    _gZkClient.deleteRecursively("/" + CLUSTER_NAME);
-    _clusterSetup = new ClusterSetup(ZK_ADDR);
-    _clusterSetup.addCluster(CLUSTER_NAME, true);
+  @Test(expectedExceptions = HelixException.class)

Review comment:
       I will look at it and confirm.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to