helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject [06/51] [partial] [HELIX-198] Unify helix code style, rb=13710
Date Wed, 21 Aug 2013 20:43:19 GMT
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/integration/manager/ZkTestManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/manager/ZkTestManager.java b/helix-core/src/test/java/org/apache/helix/integration/manager/ZkTestManager.java
index 883657e..280786c 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/manager/ZkTestManager.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/manager/ZkTestManager.java
@@ -24,8 +24,7 @@ import java.util.List;
 import org.apache.helix.manager.zk.CallbackHandler;
 import org.apache.helix.manager.zk.ZkClient;
 
-public interface ZkTestManager
-{
+public interface ZkTestManager {
   ZkClient getZkClient();
 
   List<CallbackHandler> getHandlers();

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/josql/TestClusterJosqlQueryProcessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/josql/TestClusterJosqlQueryProcessor.java b/helix-core/src/test/java/org/apache/helix/josql/TestClusterJosqlQueryProcessor.java
index 3b8d29c..8090201 100644
--- a/helix-core/src/test/java/org/apache/helix/josql/TestClusterJosqlQueryProcessor.java
+++ b/helix-core/src/test/java/org/apache/helix/josql/TestClusterJosqlQueryProcessor.java
@@ -38,67 +38,63 @@ import org.josql.QueryParseException;
 import org.josql.QueryResults;
 import org.testng.annotations.Test;
 
-
-public class TestClusterJosqlQueryProcessor
-{
-  @Test (groups = {"unitTest"})
-  public void queryClusterDataSample() 
-  {
+public class TestClusterJosqlQueryProcessor {
+  @Test(groups = {
+    "unitTest"
+  })
+  public void queryClusterDataSample() {
     List<ZNRecord> liveInstances = new ArrayList<ZNRecord>();
     Map<String, ZNRecord> liveInstanceMap = new HashMap<String, ZNRecord>();
     List<String> instances = new ArrayList<String>();
-    for(int i = 0;i<5; i++)
-    {
-      String instance = "localhost_"+(12918+i);
+    for (int i = 0; i < 5; i++) {
+      String instance = "localhost_" + (12918 + i);
       instances.add(instance);
       ZNRecord metaData = new ZNRecord(instance);
-      metaData.setSimpleField(LiveInstanceProperty.SESSION_ID.toString(),
-          UUID.randomUUID().toString());
-      metaData.setSimpleField("SCN", "" + (10-i));
+      metaData.setSimpleField(LiveInstanceProperty.SESSION_ID.toString(), UUID.randomUUID()
+          .toString());
+      metaData.setSimpleField("SCN", "" + (10 - i));
       liveInstances.add(metaData);
       liveInstanceMap.put(instance, metaData);
     }
-    
-    //liveInstances.remove(0);
-    ZNRecord externalView = DefaultIdealStateCalculator.calculateIdealState(
-        instances, 21, 3, "TestDB", "MASTER", "SLAVE");
-    
-    
+
+    // liveInstances.remove(0);
+    ZNRecord externalView =
+        DefaultIdealStateCalculator.calculateIdealState(instances, 21, 3, "TestDB", "MASTER",
+            "SLAVE");
+
     Criteria criteria = new Criteria();
     criteria.setInstanceName("%");
     criteria.setResource("TestDB");
     criteria.setRecipientInstanceType(InstanceType.PARTICIPANT);
     criteria.setPartition("TestDB_2%");
     criteria.setPartitionState("SLAVE");
-    
-    String josql = 
-      " SELECT DISTINCT mapSubKey AS 'subkey', mapValue AS 'mapValue' , getSimpleFieldValue(getZNRecordFromMap(:LIVEINSTANCESMAP, mapSubKey), 'SCN') AS 'SCN'" +
-      " FROM org.apache.helix.josql.ZNRecordRow " + 
-      " WHERE mapKey LIKE 'TestDB_2%' " +
-        " AND mapSubKey LIKE '%' " +
-        " AND mapValue LIKE 'SLAVE' " +
-        " AND mapSubKey IN ((SELECT [*]id FROM :LIVEINSTANCES)) " +
-        " ORDER BY parseInt(getSimpleFieldValue(getZNRecordFromMap(:LIVEINSTANCESMAP, mapSubKey), 'SCN'))";
-    
+
+    String josql =
+        " SELECT DISTINCT mapSubKey AS 'subkey', mapValue AS 'mapValue' , getSimpleFieldValue(getZNRecordFromMap(:LIVEINSTANCESMAP, mapSubKey), 'SCN') AS 'SCN'"
+            + " FROM org.apache.helix.josql.ZNRecordRow "
+            + " WHERE mapKey LIKE 'TestDB_2%' "
+            + " AND mapSubKey LIKE '%' "
+            + " AND mapValue LIKE 'SLAVE' "
+            + " AND mapSubKey IN ((SELECT [*]id FROM :LIVEINSTANCES)) "
+            + " ORDER BY parseInt(getSimpleFieldValue(getZNRecordFromMap(:LIVEINSTANCESMAP, mapSubKey), 'SCN'))";
+
     Query josqlQuery = new Query();
     josqlQuery.setVariable("LIVEINSTANCES", liveInstances);
     josqlQuery.setVariable("LIVEINSTANCESMAP", liveInstanceMap);
     josqlQuery.addFunctionHandler(new ZNRecordRow());
     josqlQuery.addFunctionHandler(new ZNRecordJosqlFunctionHandler());
     josqlQuery.addFunctionHandler(new Integer(0));
-    try
-    {
+    try {
       josqlQuery.parse(josql);
       QueryResults qr = josqlQuery.execute(ZNRecordRow.convertMapFields(externalView));
-      @SuppressWarnings({ "unchecked", "unused" })
+      @SuppressWarnings({
+          "unchecked", "unused"
+      })
       List<Object> result = qr.getResults();
-      
-    } 
-    catch (QueryParseException e)
-    {
+
+    } catch (QueryParseException e) {
       e.printStackTrace();
-    } catch (QueryExecutionException e)
-    {
+    } catch (QueryExecutionException e) {
       e.printStackTrace();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/josql/TestJosqlProcessor.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/josql/TestJosqlProcessor.java b/helix-core/src/test/java/org/apache/helix/josql/TestJosqlProcessor.java
index 747d8f2..aabc2b9 100644
--- a/helix-core/src/test/java/org/apache/helix/josql/TestJosqlProcessor.java
+++ b/helix-core/src/test/java/org/apache/helix/josql/TestJosqlProcessor.java
@@ -36,62 +36,63 @@ import org.apache.helix.model.LiveInstance.LiveInstanceProperty;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+public class TestJosqlProcessor extends ZkStandAloneCMTestBase {
+  @Test(groups = {
+    "integrationTest"
+  })
+  public void testJosqlQuery() throws Exception {
+    HelixManager manager =
+        ((TestHelper.StartCMResult) (_startCMResultMap.values().toArray()[0]))._manager;
 
-public class TestJosqlProcessor extends ZkStandAloneCMTestBase
-{
-  @Test (groups = {"integrationTest"})
-  public void testJosqlQuery() throws Exception
-  {
-    HelixManager manager = ((TestHelper.StartCMResult) (_startCMResultMap.values().toArray()[0]))._manager;
-    
     // Find the instance name that contains partition TestDB_2 and state is 'MASTER'
-    String SQL = "SELECT id  " + 
-        "FROM LIVEINSTANCES " + 
-        "WHERE getMapFieldValue( getZNRecordFromMap(:IDEALSTATES , 'TestDB'), :partitionName, :_currObj.id)='MASTER'";
+    String SQL =
+        "SELECT id  "
+            + "FROM LIVEINSTANCES "
+            + "WHERE getMapFieldValue( getZNRecordFromMap(:IDEALSTATES , 'TestDB'), :partitionName, :_currObj.id)='MASTER'";
     Map<String, Object> bindVariables = new HashMap<String, Object>();
     bindVariables.put("partitionName", "TestDB_2");
-    
+
     ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
     List<Object> result = p.runJoSqlQuery(SQL, bindVariables, null);
-    
+
     Assert.assertEquals(result.size(), 1);
     List<Object> firstList = (List<Object>) result.get(0);
-    Assert.assertTrue(((String)(firstList.get(0))).equalsIgnoreCase("localhost_12921"));
-    
+    Assert.assertTrue(((String) (firstList.get(0))).equalsIgnoreCase("localhost_12921"));
+
     // Find the live instances names that hosts Partition TestDB_10 according to idealstate
-    
-    SQL = "SELECT id  " + 
-        "FROM LIVEINSTANCES " + 
-        "WHERE hasMapFieldKey( getZNRecordFromMap(:IDEALSTATES, 'TestDB'), :partitionName, :_currObj.id)='true'";
+
+    SQL =
+        "SELECT id  "
+            + "FROM LIVEINSTANCES "
+            + "WHERE hasMapFieldKey( getZNRecordFromMap(:IDEALSTATES, 'TestDB'), :partitionName, :_currObj.id)='true'";
     p = new ClusterJosqlQueryProcessor(manager);
     bindVariables.put("partitionName", "TestDB_10");
     result = p.runJoSqlQuery(SQL, bindVariables, null);
-    
+
     Assert.assertEquals(result.size(), 3);
     Set<String> hosts = new HashSet<String>();
-    for(Object o : result)
-    {
-      String val = (String) ((List<Object>)o).get(0);
+    for (Object o : result) {
+      String val = (String) ((List<Object>) o).get(0);
       hosts.add(val);
     }
     Assert.assertTrue(hosts.contains("localhost_12918"));
     Assert.assertTrue(hosts.contains("localhost_12920"));
     Assert.assertTrue(hosts.contains("localhost_12921"));
-    
+
     // Find the partitions on host localhost_12919 and is on MASTER state
-    SQL = "SELECT id  " + 
-        "FROM PARTITIONS " + 
-        "WHERE getMapFieldValue( getZNRecordFromMap(:EXTERNALVIEW, 'TestDB'), id, :instanceName)='MASTER'";
+    SQL =
+        "SELECT id  "
+            + "FROM PARTITIONS "
+            + "WHERE getMapFieldValue( getZNRecordFromMap(:EXTERNALVIEW, 'TestDB'), id, :instanceName)='MASTER'";
     p = new ClusterJosqlQueryProcessor(manager);
     bindVariables.clear();
     bindVariables.put("instanceName", "localhost_12919");
     result = p.runJoSqlQuery(SQL, bindVariables, null);
-    
+
     Assert.assertEquals(result.size(), 4);
     Set<String> partitions = new HashSet<String>();
-    for(Object o : result)
-    {
-      String val = (String) ((List<Object>)o).get(0);
+    for (Object o : result) {
+      String val = (String) ((List<Object>) o).get(0);
       partitions.add(val);
     }
     Assert.assertTrue(partitions.contains("TestDB_6"));
@@ -101,128 +102,119 @@ public class TestJosqlProcessor extends ZkStandAloneCMTestBase
 
     // Find the partitions on host localhost_12919 and is on MASTER state
     // Same as above but according to currentstates
-    SQL = "SELECT id  " + 
-        "FROM PARTITIONS " + 
-        "WHERE getMapFieldValue( getZNRecordFromMap(:CURRENTSTATES, :instanceName, 'TestDB'), :_currObj.id, :mapFieldKey)=:partitionState";
-    
+    SQL =
+        "SELECT id  "
+            + "FROM PARTITIONS "
+            + "WHERE getMapFieldValue( getZNRecordFromMap(:CURRENTSTATES, :instanceName, 'TestDB'), :_currObj.id, :mapFieldKey)=:partitionState";
+
     p = new ClusterJosqlQueryProcessor(manager);
     bindVariables.clear();
     bindVariables.put("instanceName", "localhost_12919");
     bindVariables.put("mapFieldKey", "CURRENT_STATE");
     bindVariables.put("partitionState", "MASTER");
-    
-    result = p.runJoSqlQuery(SQL,  bindVariables, null);
-    
+
+    result = p.runJoSqlQuery(SQL, bindVariables, null);
+
     Assert.assertEquals(result.size(), 4);
     partitions.clear();
     partitions = new HashSet<String>();
-    for(Object o : result)
-    {
-      String val = (String) ((List<Object>)o).get(0);
+    for (Object o : result) {
+      String val = (String) ((List<Object>) o).get(0);
       partitions.add(val);
     }
     Assert.assertTrue(partitions.contains("TestDB_6"));
     Assert.assertTrue(partitions.contains("TestDB_7"));
     Assert.assertTrue(partitions.contains("TestDB_9"));
     Assert.assertTrue(partitions.contains("TestDB_14"));
-    
+
     // get node name that hosts a certain partition with certain state
-    
-    SQL = "SELECT id  " + 
-        "FROM LIVEINSTANCES " + 
-        "WHERE getMapFieldValue( getZNRecordFromMap(:CURRENTSTATES, id, 'TestDB'), :partitionName, :mapFieldKey)=:partitionState";
-    
+
+    SQL =
+        "SELECT id  "
+            + "FROM LIVEINSTANCES "
+            + "WHERE getMapFieldValue( getZNRecordFromMap(:CURRENTSTATES, id, 'TestDB'), :partitionName, :mapFieldKey)=:partitionState";
+
     p = new ClusterJosqlQueryProcessor(manager);
     bindVariables.clear();
     bindVariables.put("partitionName", "TestDB_8");
     bindVariables.put("mapFieldKey", "CURRENT_STATE");
     bindVariables.put("partitionState", "SLAVE");
-    
-    result = p.runJoSqlQuery(SQL,  bindVariables, null);
-    
+
+    result = p.runJoSqlQuery(SQL, bindVariables, null);
+
     Assert.assertEquals(result.size(), 2);
     partitions.clear();
     partitions = new HashSet<String>();
-    for(Object o : result)
-    {
-      String val = (String) ((List<Object>)o).get(0);
+    for (Object o : result) {
+      String val = (String) ((List<Object>) o).get(0);
       partitions.add(val);
     }
     Assert.assertTrue(partitions.contains("localhost_12918"));
     Assert.assertTrue(partitions.contains("localhost_12922"));
   }
-  
-  @Test (groups = {"unitTest"})
-  public void parseFromTarget() 
-  {
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void parseFromTarget() {
     ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(null);
-    String sql = "SELECT id  " + 
-        "FROM LIVEINSTANCES ";
+    String sql = "SELECT id  " + "FROM LIVEINSTANCES ";
     String from = p.parseFromTarget(sql);
     Assert.assertTrue(from.equals("LIVEINSTANCES"));
-    
-    sql = "SELECT id      " + 
-        "FROM    LIVEINSTANCES  WHERE 1=2";
-    
+
+    sql = "SELECT id      " + "FROM    LIVEINSTANCES  WHERE 1=2";
+
     from = p.parseFromTarget(sql);
     Assert.assertTrue(from.equals("LIVEINSTANCES"));
-    
-    sql = "SELECT id      " + 
-        "FROM LIVEINSTANCES";
-    
+
+    sql = "SELECT id      " + "FROM LIVEINSTANCES";
+
     from = p.parseFromTarget(sql);
     Assert.assertTrue(from.equals("LIVEINSTANCES"));
-    
-    sql = "SELECT id      " + 
-        " LIVEINSTANCES where tt=00";
+
+    sql = "SELECT id      " + " LIVEINSTANCES where tt=00";
     boolean exceptionThrown = false;
-    try
-    {
+    try {
       from = p.parseFromTarget(sql);
-    }
-    catch(HelixException e)
-    {
+    } catch (HelixException e) {
       exceptionThrown = true;
     }
     Assert.assertTrue(exceptionThrown);
   }
-  
-  @Test (groups=("unitTest"))
-  public void testOrderby() throws Exception
-  {
-    HelixManager manager = ((TestHelper.StartCMResult) (_startCMResultMap.values().toArray()[0]))._manager;
-    
+
+  @Test(groups = ("unitTest"))
+  public void testOrderby() throws Exception {
+    HelixManager manager =
+        ((TestHelper.StartCMResult) (_startCMResultMap.values().toArray()[0]))._manager;
+
     Map<String, ZNRecord> scnMap = new HashMap<String, ZNRecord>();
-    for(int i = 0;i < NODE_NR; i++)
-    {
-      String instance = "localhost_"+(12918+i);
+    for (int i = 0; i < NODE_NR; i++) {
+      String instance = "localhost_" + (12918 + i);
       ZNRecord metaData = new ZNRecord(instance);
-      metaData.setSimpleField(LiveInstanceProperty.SESSION_ID.toString(),
-          UUID.randomUUID().toString());
+      metaData.setSimpleField(LiveInstanceProperty.SESSION_ID.toString(), UUID.randomUUID()
+          .toString());
       metaData.setMapField("SCN", new HashMap<String, String>());
-      for(int j = 0;j < _PARTITIONS; j++)
-      {
-        metaData.getMapField("SCN").put(TEST_DB+"_"+j, ""+i);
+      for (int j = 0; j < _PARTITIONS; j++) {
+        metaData.getMapField("SCN").put(TEST_DB + "_" + j, "" + i);
       }
       scnMap.put(instance, metaData);
     }
     Map<String, Object> bindVariables = new HashMap<String, Object>();
     bindVariables.put("scnMap", scnMap);
-    String SQL = 
-        " SELECT DISTINCT mapSubKey AS 'subkey', mapValue AS 'mapValue' , getMapFieldValue(getZNRecordFromMap(:scnMap, mapSubKey), 'SCN', mapKey) AS 'SCN'" +
-        " FROM EXTERNALVIEW.Table " + 
-        " WHERE mapKey LIKE 'TestDB_1' " +
-          " AND mapSubKey LIKE '%' " +
-          " AND mapValue LIKE 'SLAVE' " +
-          " AND mapSubKey IN ((SELECT [*]id FROM :LIVEINSTANCES)) " +
-          " ORDER BY parseInt(getMapFieldValue(getZNRecordFromMap(:scnMap, mapSubKey), 'SCN', mapKey))";
+    String SQL =
+        " SELECT DISTINCT mapSubKey AS 'subkey', mapValue AS 'mapValue' , getMapFieldValue(getZNRecordFromMap(:scnMap, mapSubKey), 'SCN', mapKey) AS 'SCN'"
+            + " FROM EXTERNALVIEW.Table "
+            + " WHERE mapKey LIKE 'TestDB_1' "
+            + " AND mapSubKey LIKE '%' "
+            + " AND mapValue LIKE 'SLAVE' "
+            + " AND mapSubKey IN ((SELECT [*]id FROM :LIVEINSTANCES)) "
+            + " ORDER BY parseInt(getMapFieldValue(getZNRecordFromMap(:scnMap, mapSubKey), 'SCN', mapKey))";
 
     ClusterJosqlQueryProcessor p = new ClusterJosqlQueryProcessor(manager);
     List<Object> result = p.runJoSqlQuery(SQL, bindVariables, null);
     int prevSCN = -1;
-    for(Object row : result)
-    {
-      List<String> stringRow = (List<String>)row;
+    for (Object row : result) {
+      List<String> stringRow = (List<String>) row;
       Assert.assertTrue(stringRow.get(1).equals("SLAVE"));
       int scn = Integer.parseInt(stringRow.get(2));
       Assert.assertTrue(scn > prevSCN);

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/MockListener.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/MockListener.java b/helix-core/src/test/java/org/apache/helix/manager/MockListener.java
index b8c27be..376481e 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/MockListener.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/MockListener.java
@@ -36,7 +36,6 @@ import org.apache.helix.model.InstanceConfig;
 import org.apache.helix.model.LiveInstance;
 import org.apache.helix.model.Message;
 
-
 public class MockListener implements IdealStateChangeListener, LiveInstanceChangeListener,
     ConfigChangeListener, CurrentStateChangeListener, ExternalViewChangeListener,
     ControllerChangeListener, MessageListener
@@ -50,8 +49,7 @@ public class MockListener implements IdealStateChangeListener, LiveInstanceChang
   public boolean isExternalViewChangeListenerInvoked = false;
   public boolean isControllerChangeListenerInvoked = false;
 
-  public void reset()
-  {
+  public void reset() {
     isIdealStateChangeListenerInvoked = false;
     isLiveInstanceChangeListenerInvoked = false;
     isCurrentStateChangeListenerInvoked = false;
@@ -62,49 +60,41 @@ public class MockListener implements IdealStateChangeListener, LiveInstanceChang
   }
 
   @Override
-  public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext)
-  {
+  public void onIdealStateChange(List<IdealState> idealState, NotificationContext changeContext) {
     isIdealStateChangeListenerInvoked = true;
   }
 
   @Override
-  public void onLiveInstanceChange(List<LiveInstance> liveInstances, NotificationContext changeContext)
-  {
+  public void onLiveInstanceChange(List<LiveInstance> liveInstances,
+      NotificationContext changeContext) {
     isLiveInstanceChangeListenerInvoked = true;
   }
 
   @Override
-  public void onConfigChange(List<InstanceConfig> configs, NotificationContext changeContext)
-  {
+  public void onConfigChange(List<InstanceConfig> configs, NotificationContext changeContext) {
     isConfigChangeListenerInvoked = true;
   }
 
   @Override
-  public void onStateChange(String instanceName,
-                            List<CurrentState> statesInfo,
-                            NotificationContext changeContext)
-  {
+  public void onStateChange(String instanceName, List<CurrentState> statesInfo,
+      NotificationContext changeContext) {
     isCurrentStateChangeListenerInvoked = true;
   }
 
   @Override
   public void onExternalViewChange(List<ExternalView> externalViewList,
-                                   NotificationContext changeContext)
-  {
+      NotificationContext changeContext) {
     isExternalViewChangeListenerInvoked = true;
   }
 
   @Override
-  public void onControllerChange(NotificationContext changeContext)
-  {
+  public void onControllerChange(NotificationContext changeContext) {
     isControllerChangeListenerInvoked = true;
   }
 
   @Override
-  public void onMessage(String instanceName,
-                        List<Message> messages,
-                        NotificationContext changeContext)
-  {
+  public void onMessage(String instanceName, List<Message> messages,
+      NotificationContext changeContext) {
     isMessageListenerInvoked = true;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestDefaultControllerMsgHandlerFactory.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestDefaultControllerMsgHandlerFactory.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestDefaultControllerMsgHandlerFactory.java
index 63553e0..a6aeb03 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestDefaultControllerMsgHandlerFactory.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestDefaultControllerMsgHandlerFactory.java
@@ -33,13 +33,11 @@ import org.apache.helix.model.Message.MessageType;
 import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
-
-public class TestDefaultControllerMsgHandlerFactory
-{
+public class TestDefaultControllerMsgHandlerFactory {
   @Test()
-  public void testDefaultControllerMsgHandlerFactory()
-  {
-  	System.out.println("START TestDefaultControllerMsgHandlerFactory at " + new Date(System.currentTimeMillis()));
+  public void testDefaultControllerMsgHandlerFactory() {
+    System.out.println("START TestDefaultControllerMsgHandlerFactory at "
+        + new Date(System.currentTimeMillis()));
 
     DefaultControllerMessageHandlerFactory facotry = new DefaultControllerMessageHandlerFactory();
 
@@ -47,38 +45,31 @@ public class TestDefaultControllerMsgHandlerFactory
     NotificationContext context = new NotificationContext(null);
 
     boolean exceptionCaught = false;
-    try
-    {
+    try {
       MessageHandler handler = facotry.createHandler(message, context);
-    } catch (HelixException e)
-    {
+    } catch (HelixException e) {
       exceptionCaught = true;
     }
     AssertJUnit.assertTrue(exceptionCaught);
 
     message = new Message(MessageType.CONTROLLER_MSG, "1");
     exceptionCaught = false;
-    try
-    {
+    try {
       MessageHandler handler = facotry.createHandler(message, context);
-    } catch (HelixException e)
-    {
+    } catch (HelixException e) {
       exceptionCaught = true;
     }
     AssertJUnit.assertFalse(exceptionCaught);
 
     Map<String, String> resultMap = new HashMap<String, String>();
     message = new Message(MessageType.NO_OP, "3");
-    DefaultControllerMessageHandler defaultHandler = new DefaultControllerMessageHandler(message, context);
-    try
-    {
+    DefaultControllerMessageHandler defaultHandler =
+        new DefaultControllerMessageHandler(message, context);
+    try {
       defaultHandler.handleMessage();
-    } catch (HelixException e)
-    {
+    } catch (HelixException e) {
       exceptionCaught = true;
-    }
-    catch (InterruptedException e)
-    {
+    } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
@@ -87,20 +78,17 @@ public class TestDefaultControllerMsgHandlerFactory
     message = new Message(MessageType.CONTROLLER_MSG, "4");
     defaultHandler = new DefaultControllerMessageHandler(message, context);
     exceptionCaught = false;
-    try
-    {
+    try {
       defaultHandler.handleMessage();
-    } catch (HelixException e)
-    {
+    } catch (HelixException e) {
       exceptionCaught = true;
-    }
-    catch (InterruptedException e)
-    {
+    } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
     AssertJUnit.assertFalse(exceptionCaught);
-    System.out.println("END TestDefaultControllerMsgHandlerFactory at " + new Date(System.currentTimeMillis()));
+    System.out.println("END TestDefaultControllerMsgHandlerFactory at "
+        + new Date(System.currentTimeMillis()));
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestHandleNewSession.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestHandleNewSession.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestHandleNewSession.java
index 3346654..f9afe91 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestHandleNewSession.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestHandleNewSession.java
@@ -29,62 +29,52 @@ import org.apache.helix.manager.zk.ZKHelixManager;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestHandleNewSession extends ZkIntegrationTestBase
-{
+public class TestHandleNewSession extends ZkIntegrationTestBase {
   @Test
-  public void testHandleNewSession() throws Exception
-  {
+  public void testHandleNewSession() throws Exception {
     // Logger.getRootLogger().setLevel(Level.INFO);
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
 
-    
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
+
     TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, // participant port
-                            "localhost", // participant name prefix
-                            "TestDB", // resource name prefix
-                            1, // resources
-                            10, // partitions per resource
-                            5, // number of nodes
-                            3, // replicas
-                            "MasterSlave",
-                            true); // do rebalance
+        "localhost", // participant name prefix
+        "TestDB", // resource name prefix
+        1, // resources
+        10, // partitions per resource
+        5, // number of nodes
+        3, // replicas
+        "MasterSlave", true); // do rebalance
 
     ZKHelixManager manager =
-        new ZKHelixManager(clusterName,
-                               "localhost_12918",
-                               InstanceType.PARTICIPANT,
-                               ZK_ADDR);
+        new ZKHelixManager(clusterName, "localhost_12918", InstanceType.PARTICIPANT, ZK_ADDR);
     manager.connect();
-   
+
     // Logger.getRootLogger().setLevel(Level.INFO);
     String lastSessionId = manager.getSessionId();
-    for (int i = 0; i < 3; i++)
-    {
+    for (int i = 0; i < 3; i++) {
       // System.err.println("curSessionId: " + lastSessionId);
       ZkTestHelper.expireSession(manager._zkClient);
 
       String sessionId = manager.getSessionId();
-      Assert.assertTrue(sessionId.compareTo(lastSessionId) > 0, "Session id should be increased after expiry");
+      Assert.assertTrue(sessionId.compareTo(lastSessionId) > 0,
+          "Session id should be increased after expiry");
       lastSessionId = sessionId;
 
       // make sure session id is not 0
       Assert.assertFalse(sessionId.equals("0"),
-                         "Hit race condition in zhclient.handleNewSession(). sessionId is not returned yet.");
-      
+          "Hit race condition in zhclient.handleNewSession(). sessionId is not returned yet.");
+
       // TODO: need to test session expiry during handleNewSession()
     }
 
     // Logger.getRootLogger().setLevel(Level.INFO);
     System.out.println("Disconnecting ...");
     manager.disconnect();
-    
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestLiveInstanceBounce.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestLiveInstanceBounce.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestLiveInstanceBounce.java
index 732e68a..23fdbfa 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestLiveInstanceBounce.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestLiveInstanceBounce.java
@@ -29,29 +29,22 @@ import org.apache.helix.tools.ClusterStateVerifier;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestLiveInstanceBounce extends ZkStandAloneCMTestBaseWithPropertyServerCheck
-{
+public class TestLiveInstanceBounce extends ZkStandAloneCMTestBaseWithPropertyServerCheck {
   @Test
-  public void testInstanceBounce() throws Exception
-  {
+  public void testInstanceBounce() throws Exception {
     String controllerName = CONTROLLER_PREFIX + "_0";
     StartCMResult controllerResult = _startCMResultMap.get(controllerName);
     ZkHelixTestManager controller = (ZkHelixTestManager) controllerResult._manager;
     int handlerSize = controller.getHandlers().size();
 
-    for (int i = 0; i < 2; i++)
-    {
+    for (int i = 0; i < 2; i++) {
       String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
       // kill 2 participants
       _startCMResultMap.get(instanceName)._manager.disconnect();
       _startCMResultMap.get(instanceName)._thread.interrupt();
-      try
-      {
+      try {
         Thread.sleep(1000);
-      }
-      catch (InterruptedException e)
-      {
+      } catch (InterruptedException e) {
         e.printStackTrace();
       }
       // restart the participant
@@ -61,21 +54,20 @@ public class TestLiveInstanceBounce extends ZkStandAloneCMTestBaseWithPropertySe
     }
     Thread.sleep(4000);
 
-    boolean result = ClusterStateVerifier.verifyByPolling(
-        new ClusterStateVerifier.BestPossAndExtViewZkVerifier(ZK_ADDR, CLUSTER_NAME), 50 * 1000);
+    boolean result =
+        ClusterStateVerifier.verifyByPolling(new ClusterStateVerifier.BestPossAndExtViewZkVerifier(
+            ZK_ADDR, CLUSTER_NAME), 50 * 1000);
     Assert.assertTrue(result);
 
     // When a new live instance is created, we add current state listener to it
     // and we will remove current-state listener on expired session
     // so the number of callback handlers is unchanged
-    for (int j = 0; j < 10; j++)
-    {
-      if(controller.getHandlers().size() == (handlerSize))
-      {
+    for (int j = 0; j < 10; j++) {
+      if (controller.getHandlers().size() == (handlerSize)) {
         break;
       }
       Thread.sleep(400);
     }
-    Assert.assertEquals( controller.getHandlers().size(), handlerSize);
+    Assert.assertEquals(controller.getHandlers().size(), handlerSize);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpMultiThread.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpMultiThread.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpMultiThread.java
index 7b56564..aa0bd2b 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpMultiThread.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpMultiThread.java
@@ -38,67 +38,54 @@ import org.apache.helix.manager.zk.ZkCacheBaseDataAccessor;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
-{
-  class TestCreateZkCacheBaseDataAccessor implements Callable<Boolean>
-  {
+public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase {
+  class TestCreateZkCacheBaseDataAccessor implements Callable<Boolean> {
     final ZkCacheBaseDataAccessor<ZNRecord> _accessor;
-    final String                         _clusterName;
+    final String _clusterName;
     final int _id;
 
-    public TestCreateZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor, String clusterName, int id)
-    {
+    public TestCreateZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor,
+        String clusterName, int id) {
       _accessor = accessor;
       _clusterName = clusterName;
       _id = id;
     }
 
     @Override
-    public Boolean call() throws Exception
-    {
+    public Boolean call() throws Exception {
       // create 10 current states in 2 steps
       List<String> paths = new ArrayList<String>();
       List<ZNRecord> records = new ArrayList<ZNRecord>();
-      for (int j = 0; j < 2; j++)
-      {
+      for (int j = 0; j < 2; j++) {
         paths.clear();
         records.clear();
 
-        if (_id == 1 && j == 0)
-        {
+        if (_id == 1 && j == 0) {
           // let thread_0 create 0-4
           Thread.sleep(30);
         }
 
-        if (_id == 0 && j == 1)
-        {
+        if (_id == 0 && j == 1) {
           // let thread_1 create 5-9
           Thread.sleep(100);
         }
-        
-        
-        for (int i = 0; i < 5; i++)
-        {
+
+        for (int i = 0; i < 5; i++) {
           int k = j * 5 + i;
           String path =
-              PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                         _clusterName,
-                                         "localhost_8901",
-                                         "session_0",
-                                         "TestDB" + k);
+              PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, _clusterName,
+                  "localhost_8901", "session_0", "TestDB" + k);
           ZNRecord record = new ZNRecord("TestDB" + k);
 
           paths.add(path);
           records.add(record);
         }
-        
+
         boolean[] success = _accessor.createChildren(paths, records, AccessOption.PERSISTENT);
-        // System.out.println("thread-" + _id + " creates " + j  + ": " + Arrays.toString(success));
-        
+        // System.out.println("thread-" + _id + " creates " + j + ": " + Arrays.toString(success));
+
         // create all all sync'ed, so we shall see either all true or all false
-        for (int i = 1; i < 5; i++)
-        {
+        for (int i = 1; i < 5; i++) {
           Assert.assertEquals(success[i], success[0], "Should be either all succeed of all fail");
         }
       }
@@ -106,52 +93,44 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
       return true;
     }
   }
-  
-  class TestUpdateZkCacheBaseDataAccessor implements Callable<Boolean>
-  {
+
+  class TestUpdateZkCacheBaseDataAccessor implements Callable<Boolean> {
     final ZkCacheBaseDataAccessor<ZNRecord> _accessor;
-    final String                         _clusterName;
+    final String _clusterName;
     final int _id;
 
-    public TestUpdateZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor, String clusterName, int id)
-    {
+    public TestUpdateZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor,
+        String clusterName, int id) {
       _accessor = accessor;
       _clusterName = clusterName;
       _id = id;
     }
 
     @Override
-    public Boolean call() throws Exception
-    {
+    public Boolean call() throws Exception {
       // create 10 current states in 2 steps
       List<String> paths = new ArrayList<String>();
       List<DataUpdater<ZNRecord>> updaters = new ArrayList<DataUpdater<ZNRecord>>();
-      for (int j = 0; j < 10; j++)
-      {
+      for (int j = 0; j < 10; j++) {
         paths.clear();
         updaters.clear();
 
-        for (int i = 0; i < 10; i++)
-        {
+        for (int i = 0; i < 10; i++) {
           String path =
-              PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                         _clusterName,
-                                         "localhost_8901",
-                                         "session_0",
-                                         "TestDB" + i);
-          
+              PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, _clusterName,
+                  "localhost_8901", "session_0", "TestDB" + i);
+
           ZNRecord newRecord = new ZNRecord("TestDB" + i);
           newRecord.setSimpleField("" + j, "" + j);
           DataUpdater<ZNRecord> updater = new ZNRecordUpdater(newRecord);
           paths.add(path);
           updaters.add(updater);
         }
-        
+
         boolean[] success = _accessor.updateChildren(paths, updaters, AccessOption.PERSISTENT);
         // System.out.println("thread-" + _id + " updates " + j + ": " + Arrays.toString(success));
-        
-        for (int i = 0; i < 10; i++)
-        {
+
+        for (int i = 0; i < 10; i++) {
           Assert.assertEquals(success[i], true, "Should be all succeed");
         }
       }
@@ -159,45 +138,39 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
       return true;
     }
   }
-  
-  class TestSetZkCacheBaseDataAccessor implements Callable<Boolean>
-  {
+
+  class TestSetZkCacheBaseDataAccessor implements Callable<Boolean> {
     final ZkCacheBaseDataAccessor<ZNRecord> _accessor;
-    final String                         _clusterName;
+    final String _clusterName;
     final int _id;
 
-    public TestSetZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor, String clusterName, int id)
-    {
+    public TestSetZkCacheBaseDataAccessor(ZkCacheBaseDataAccessor<ZNRecord> accessor,
+        String clusterName, int id) {
       _accessor = accessor;
       _clusterName = clusterName;
       _id = id;
     }
 
     @Override
-    public Boolean call() throws Exception
-    {
+    public Boolean call() throws Exception {
       // create 10 current states in 2 steps
       List<String> paths = new ArrayList<String>();
       List<ZNRecord> records = new ArrayList<ZNRecord>();
-      for (int j = 0; j < 2; j++)
-      {
+      for (int j = 0; j < 2; j++) {
         paths.clear();
         records.clear();
 
-        if (_id == 1 && j == 0)
-        {
+        if (_id == 1 && j == 0) {
           // let thread_0 create 0-4
           Thread.sleep(30);
         }
 
-        if (_id == 0 && j == 1)
-        {
+        if (_id == 0 && j == 1) {
           // let thread_1 create 5-9
           Thread.sleep(100);
         }
 
-        for (int i = 0; i < 5; i++)
-        {
+        for (int i = 0; i < 5; i++) {
           int k = j * 5 + i;
           String path =
               PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, _clusterName, "TestDB" + k);
@@ -207,10 +180,9 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
           records.add(record);
         }
         boolean[] success = _accessor.setChildren(paths, records, AccessOption.PERSISTENT);
-        // System.out.println("thread-" + _id + " sets " + j  + ": " + Arrays.toString(success));
-        
-        for (int i = 0; i < 5; i++)
-        {
+        // System.out.println("thread-" + _id + " sets " + j + ": " + Arrays.toString(success));
+
+        for (int i = 0; i < 5; i++) {
           Assert.assertEquals(success[i], true);
         }
       }
@@ -218,35 +190,26 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
       return true;
     }
   }
-  
+
   @Test
-  public void testHappyPathZkCacheBaseDataAccessor()
-  {
+  public void testHappyPathZkCacheBaseDataAccessor() {
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     // init zkCacheDataAccessor
     String curStatePath =
-        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                   clusterName,
-                                   "localhost_8901");
-    String extViewPath =
-        PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
+        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901");
+    String extViewPath = PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
 
-    ZkBaseDataAccessor<ZNRecord> baseAccessor =
-        new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
+    ZkBaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
 
     baseAccessor.create(curStatePath, null, AccessOption.PERSISTENT);
 
     List<String> cachePaths = Arrays.asList(curStatePath, extViewPath);
     ZkCacheBaseDataAccessor<ZNRecord> accessor =
-        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor,
-                                           null,
-                                           cachePaths,
-                                           null);
+        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor, null, cachePaths, null);
 
     // TestHelper.printCache(accessor._wtCache);
     boolean ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
@@ -254,8 +217,7 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
 
     // create 10 current states using 2 threads
     List<Callable<Boolean>> threads = new ArrayList<Callable<Boolean>>();
-    for (int i = 0; i < 2; i++)
-    {
+    for (int i = 0; i < 2; i++) {
       threads.add(new TestCreateZkCacheBaseDataAccessor(accessor, clusterName, i));
     }
     TestHelper.startThreadsConcurrently(threads, 1000);
@@ -264,15 +226,14 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
     // TestHelper.printCache(accessor._wtCache);
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
-    
+
     // update 10 current states 10 times using 2 threads
     threads.clear();
-    for (int i = 0; i < 2; i++)
-    {
+    for (int i = 0; i < 2; i++) {
       threads.add(new TestUpdateZkCacheBaseDataAccessor(accessor, clusterName, i));
     }
     TestHelper.startThreadsConcurrently(threads, 1000);
-    
+
     // verify wtCache
     // TestHelper.printCache(accessor._wtCache);
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
@@ -280,18 +241,16 @@ public class TestWtCacheAsyncOpMultiThread extends ZkUnitTestBase
 
     // set 10 external views using 2 threads
     threads.clear();
-    for (int i = 0; i < 2; i++)
-    {
+    for (int i = 0; i < 2; i++) {
       threads.add(new TestSetZkCacheBaseDataAccessor(accessor, clusterName, i));
     }
     TestHelper.startThreadsConcurrently(threads, 1000);
-    
+
     // verify wtCache
     // TestHelper.printCache(accessor._wtCache);
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
-    
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpSingleThread.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpSingleThread.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpSingleThread.java
index 6d492b0..4d684d3 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpSingleThread.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheAsyncOpSingleThread.java
@@ -37,53 +37,37 @@ import org.apache.helix.manager.zk.ZkCacheBaseDataAccessor;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
-{
+public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase {
   @Test
-  public void testHappyPathZkCacheBaseDataAccessor()
-  {
+  public void testHappyPathZkCacheBaseDataAccessor() {
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     // init zkCacheDataAccessor
     String curStatePath =
-        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                   clusterName,
-                                   "localhost_8901");
-    String extViewPath =
-        PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
+        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901");
+    String extViewPath = PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
 
-    ZkBaseDataAccessor<ZNRecord> baseAccessor =
-        new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
+    ZkBaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
 
     baseAccessor.create(curStatePath, null, AccessOption.PERSISTENT);
 
     List<String> cachePaths = Arrays.asList(curStatePath, extViewPath);
     ZkCacheBaseDataAccessor<ZNRecord> accessor =
-        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor,
-                                           null,
-                                           cachePaths,
-                                           null);
+        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor, null, cachePaths, null);
 
     boolean ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // create 10 current states
     List<String> paths = new ArrayList<String>();
     List<ZNRecord> records = new ArrayList<ZNRecord>();
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_0",
-                                     "TestDB" + i);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_0", "TestDB" + i);
       ZNRecord record = new ZNRecord("TestDB" + i);
 
       paths.add(path);
@@ -91,8 +75,7 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
     }
 
     boolean[] success = accessor.createChildren(paths, records, AccessOption.PERSISTENT);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertTrue(success[i], "Should succeed in create: " + paths.get(i));
     }
 
@@ -101,15 +84,12 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // update each current state 10 times
     List<DataUpdater<ZNRecord>> updaters = new ArrayList<DataUpdater<ZNRecord>>();
-    for (int j = 0; j < 10; j++)
-    {
+    for (int j = 0; j < 10; j++) {
       paths.clear();
       updaters.clear();
-      for (int i = 0; i < 10; i++)
-      {
+      for (int i = 0; i < 10; i++) {
         String path = curStatePath + "/session_0/TestDB" + i;
         ZNRecord newRecord = new ZNRecord("TestDB" + i);
         newRecord.setSimpleField("" + j, "" + j);
@@ -119,8 +99,7 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
       }
       success = accessor.updateChildren(paths, updaters, AccessOption.PERSISTENT);
 
-      for (int i = 0; i < 10; i++)
-      {
+      for (int i = 0; i < 10; i++) {
         Assert.assertTrue(success[i], "Should succeed in update: " + paths.get(i));
       }
     }
@@ -130,12 +109,10 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // set 10 external views
     paths.clear();
     records.clear();
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
           PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName, "TestDB" + i);
       ZNRecord record = new ZNRecord("TestDB" + i);
@@ -144,8 +121,7 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
       records.add(record);
     }
     success = accessor.setChildren(paths, records, AccessOption.PERSISTENT);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertTrue(success[i], "Should succeed in set: " + paths.get(i));
     }
 
@@ -154,96 +130,74 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // get 10 external views
     paths.clear();
     records.clear();
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
           PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName, "TestDB" + i);
       paths.add(path);
     }
 
     records = accessor.get(paths, null, 0);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertEquals(records.get(i).getId(), "TestDB" + i);
     }
 
     // getChildren
     records.clear();
     records = accessor.getChildren(extViewPath, null, 0);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertEquals(records.get(i).getId(), "TestDB" + i);
     }
 
     // exists
     paths.clear();
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_0",
-                                     "TestDB" + i);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_0", "TestDB" + i);
       paths.add(path);
     }
     success = accessor.exists(paths, 0);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertTrue(success[i], "Should exits: TestDB" + i);
     }
 
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
   }
-  
+
   @Test
-  public void testCreateFailZkCacheBaseAccessor()
-  {
+  public void testCreateFailZkCacheBaseAccessor() {
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     // init zkCacheDataAccessor
     String curStatePath =
-        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                   clusterName,
-                                   "localhost_8901");
-    String extViewPath =
-        PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
+        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901");
+    String extViewPath = PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
 
-    ZkBaseDataAccessor<ZNRecord> baseAccessor =
-        new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
+    ZkBaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
 
     baseAccessor.create(curStatePath, null, AccessOption.PERSISTENT);
 
     ZkCacheBaseDataAccessor<ZNRecord> accessor =
-        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor,
-                                           null,
-                                           Arrays.asList(curStatePath, extViewPath),
-                                           null);
+        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor, null, Arrays.asList(curStatePath,
+            extViewPath), null);
 
-    Assert.assertEquals(accessor._wtCache._cache.size(), 1, "Should contain only:\n"
-        + curStatePath);
+    Assert
+        .assertEquals(accessor._wtCache._cache.size(), 1, "Should contain only:\n" + curStatePath);
     Assert.assertTrue(accessor._wtCache._cache.containsKey(curStatePath));
 
     // create 10 current states
     List<String> paths = new ArrayList<String>();
     List<ZNRecord> records = new ArrayList<ZNRecord>();
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_1",
-                                     "TestDB" + i);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_1", "TestDB" + i);
       ZNRecord record = new ZNRecord("TestDB" + i);
 
       paths.add(path);
@@ -251,22 +205,18 @@ public class TestWtCacheAsyncOpSingleThread extends ZkUnitTestBase
     }
 
     boolean[] success = accessor.createChildren(paths, records, AccessOption.PERSISTENT);
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertTrue(success[i], "Should succeed in create: " + paths.get(i));
     }
-    
-    
+
     // create same 10 current states again, should fail on NodeExists
     success = accessor.createChildren(paths, records, AccessOption.PERSISTENT);
     // System.out.println(Arrays.toString(success));
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertFalse(success[i], "Should fail on create: " + paths.get(i));
     }
-    
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheSyncOpSingleThread.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheSyncOpSingleThread.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheSyncOpSingleThread.java
index 1691775..edbcedc 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheSyncOpSingleThread.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestWtCacheSyncOpSingleThread.java
@@ -35,50 +35,36 @@ import org.apache.helix.manager.zk.ZkCacheBaseDataAccessor;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase
-{
+public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase {
   // TODO: add TestZkCacheSyncOpSingleThread
   // TODO: add TestZkCacheAsyncOpMultiThread
   @Test
-  public void testHappyPathZkCacheBaseDataAccessor() throws Exception
-  {
+  public void testHappyPathZkCacheBaseDataAccessor() throws Exception {
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     // init zkCacheDataAccessor
     String curStatePath =
-        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                   clusterName,
-                                   "localhost_8901");
-    String extViewPath =
-        PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
+        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901");
+    String extViewPath = PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName);
 
-    ZkBaseDataAccessor<ZNRecord> baseAccessor =
-        new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
+    ZkBaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
 
     baseAccessor.create(curStatePath, null, AccessOption.PERSISTENT);
 
     List<String> cachePaths = Arrays.asList(curStatePath, extViewPath);
     ZkCacheBaseDataAccessor<ZNRecord> accessor =
-        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor,
-                                           null,
-                                           cachePaths,
-                                           null);
-    
+        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor, null, cachePaths, null);
+
     boolean ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, true);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // create 10 current states
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path = curStatePath + "/session_0/TestDB" + i;
-      boolean success =
-          accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
+      boolean success = accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
       Assert.assertTrue(success, "Should succeed in create: " + path);
     }
 
@@ -88,11 +74,9 @@ public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
     // update each current state 10 times, single thread
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path = curStatePath + "/session_0/TestDB" + i;
-      for (int j = 0; j < 10; j++)
-      {
+      for (int j = 0; j < 10; j++) {
         ZNRecord newRecord = new ZNRecord("TestDB" + i);
         newRecord.setSimpleField("" + j, "" + j);
         boolean success =
@@ -103,13 +87,12 @@ public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase
     }
 
     // verify cache
-//    TestHelper.printCache(accessor._wtCache._cache);
+    // TestHelper.printCache(accessor._wtCache._cache);
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
     // set 10 external views
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
           PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName, "TestDB" + i);
       boolean success = accessor.set(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
@@ -121,10 +104,8 @@ public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase
     ret = TestHelper.verifyZkCache(cachePaths, accessor._wtCache._cache, _gZkClient, false);
     Assert.assertTrue(ret, "wtCache doesn't match data on Zk");
 
-
     // get 10 external views
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
           PropertyPathConfig.getPath(PropertyType.EXTERNALVIEW, clusterName, "TestDB" + i);
       ZNRecord record = accessor.get(path, null, 0);
@@ -135,81 +116,56 @@ public class TestWtCacheSyncOpSingleThread extends ZkUnitTestBase
     List<String> childNames = accessor.getChildNames(extViewPath, 0);
     // System.out.println(childNames);
     Assert.assertEquals(childNames.size(), 10, "Should contain only: TestDB0-9");
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       Assert.assertTrue(childNames.contains("TestDB" + i));
     }
-    
+
     // exists
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_0",
-                                     "TestDB" + i);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_0", "TestDB" + i);
 
       Assert.assertTrue(accessor.exists(path, 0));
     }
-    
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
   }
-  
+
   @Test
-  public void testCreateFailZkCacheBaseDataAccessor()
-  {
+  public void testCreateFailZkCacheBaseDataAccessor() {
     String className = TestHelper.getTestClassName();
     String methodName = TestHelper.getTestMethodName();
     String clusterName = className + "_" + methodName;
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     // init zkCacheDataAccessor
     String curStatePath =
-        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                   clusterName,
-                                   "localhost_8901");
-    
-    ZkBaseDataAccessor<ZNRecord> baseAccessor =
-        new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
+        PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901");
+
+    ZkBaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<ZNRecord>(_gZkClient);
 
     ZkCacheBaseDataAccessor<ZNRecord> accessor =
-        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor,
-                                           null,
-                                           Arrays.asList(curStatePath),
-                                           null);
+        new ZkCacheBaseDataAccessor<ZNRecord>(baseAccessor, null, Arrays.asList(curStatePath), null);
 
     // create 10 current states
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_1",
-                                     "TestDB" + i);
-      boolean success =
-          accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_1", "TestDB" + i);
+      boolean success = accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
       Assert.assertTrue(success, "Should succeed in create: " + path);
     }
-    
+
     // create same 10 current states again, should fail
-    for (int i = 0; i < 10; i++)
-    {
+    for (int i = 0; i < 10; i++) {
       String path =
-          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES,
-                                     clusterName,
-                                     "localhost_8901",
-                                     "session_1",
-                                     "TestDB" + i);
-      boolean success =
-          accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
+          PropertyPathConfig.getPath(PropertyType.CURRENTSTATES, clusterName, "localhost_8901",
+              "session_1", "TestDB" + i);
+      boolean success = accessor.create(path, new ZNRecord("TestDB" + i), AccessOption.PERSISTENT);
       Assert.assertFalse(success, "Should fail in create due to NodeExists: " + path);
     }
 
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKLiveInstanceData.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKLiveInstanceData.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKLiveInstanceData.java
index f81cf3f..0044630 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKLiveInstanceData.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKLiveInstanceData.java
@@ -43,46 +43,37 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-
-public class TestZKLiveInstanceData extends ZkUnitTestBase
-{
+public class TestZKLiveInstanceData extends ZkUnitTestBase {
   private final String clusterName = CLUSTER_PREFIX + "_" + getShortClassName();
 
   @Test
-  public void testDataChange() throws Exception
-  {
+  public void testDataChange() throws Exception {
     // Create an admin and add LiveInstanceChange listener to it
     HelixManager adminManager =
-        HelixManagerFactory.getZKHelixManager(clusterName,
-                                              null,
-                                              InstanceType.ADMINISTRATOR,
-                                              ZK_ADDR);
+        HelixManagerFactory.getZKHelixManager(clusterName, null, InstanceType.ADMINISTRATOR,
+            ZK_ADDR);
     adminManager.connect();
     final BlockingQueue<List<LiveInstance>> changeList =
         new LinkedBlockingQueue<List<LiveInstance>>();
 
-    adminManager.addLiveInstanceChangeListener(new LiveInstanceChangeListener()
-    {
+    adminManager.addLiveInstanceChangeListener(new LiveInstanceChangeListener() {
       @Override
       public void onLiveInstanceChange(List<LiveInstance> liveInstances,
-                                       NotificationContext changeContext)
-      {
+          NotificationContext changeContext) {
         // The queue is basically unbounded, so shouldn't throw exception when calling
         // "add".
         changeList.add(deepCopy(liveInstances));
       }
     });
-    
+
     // Check the initial condition
     List<LiveInstance> instances = changeList.poll(1, TimeUnit.SECONDS);
     Assert.assertNotNull(instances, "Expecting a list of live instance");
     Assert.assertTrue(instances.isEmpty(), "Expecting an empty list of live instance");
     // Join as participant, should trigger a live instance change event
     HelixManager manager =
-        HelixManagerFactory.getZKHelixManager(clusterName,
-                                              "localhost_54321",
-                                              InstanceType.PARTICIPANT,
-                                              ZK_ADDR);
+        HelixManagerFactory.getZKHelixManager(clusterName, "localhost_54321",
+            InstanceType.PARTICIPANT, ZK_ADDR);
     manager.connect();
     instances = changeList.poll(1, TimeUnit.SECONDS);
     Assert.assertNotNull(instances, "Expecting a list of live instance");
@@ -99,13 +90,11 @@ public class TestZKLiveInstanceData extends ZkUnitTestBase
     map.put("k1", "v1");
     instance.getRecord().setMapField("test", map);
     Assert.assertTrue(helixDataAccessor.updateProperty(propertyKey, instance),
-                      "Failed to update live instance node");
+        "Failed to update live instance node");
 
     instances = changeList.poll(1, TimeUnit.SECONDS);
     Assert.assertNotNull(instances, "Expecting a list of live instance");
-    Assert.assertEquals(instances.get(0).getRecord().getMapField("test"),
-                        map,
-                        "Wrong map data.");
+    Assert.assertEquals(instances.get(0).getRecord().getMapField("test"), map, "Wrong map data.");
     manager.disconnect();
     Thread.sleep(1000); // wait for callback finish
 
@@ -118,52 +107,34 @@ public class TestZKLiveInstanceData extends ZkUnitTestBase
   }
 
   @BeforeClass()
-  public void beforeClass() throws Exception
-  {
+  public void beforeClass() throws Exception {
     ZkClient zkClient = null;
-    try
-    {
+    try {
       zkClient = new ZkClient(ZK_ADDR);
       zkClient.setZkSerializer(new ZNRecordSerializer());
-      if (zkClient.exists("/" + clusterName))
-      {
+      if (zkClient.exists("/" + clusterName)) {
         zkClient.deleteRecursive("/" + clusterName);
       }
-    }
-    finally
-    {
-      if (zkClient != null)
-      {
+    } finally {
+      if (zkClient != null) {
         zkClient.close();
       }
     }
 
-    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr",
-                                                ZK_ADDR,
-                                                "-addCluster",
-                                                clusterName));
-    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr",
-                                                ZK_ADDR,
-                                                "-addNode",
-                                                clusterName,
-                                                "localhost:54321"));
-    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr",
-                                                ZK_ADDR,
-                                                "-addNode",
-                                                clusterName,
-                                                "localhost:54322"));
+    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr", ZK_ADDR, "-addCluster", clusterName));
+    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr", ZK_ADDR, "-addNode", clusterName,
+        "localhost:54321"));
+    ClusterSetup.processCommandLineArgs(getArgs("-zkSvr", ZK_ADDR, "-addNode", clusterName,
+        "localhost:54322"));
   }
 
-  private String[] getArgs(String... args)
-  {
+  private String[] getArgs(String... args) {
     return args;
   }
 
-  private List<LiveInstance> deepCopy(List<LiveInstance> instances)
-  {
+  private List<LiveInstance> deepCopy(List<LiveInstance> instances) {
     List<LiveInstance> result = new ArrayList<LiveInstance>();
-    for (LiveInstance instance : instances)
-    {
+    for (LiveInstance instance : instances) {
       result.add(new LiveInstance(instance.getRecord()));
     }
     return result;

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKPropertyTransferServer.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKPropertyTransferServer.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKPropertyTransferServer.java
index 0128290..f40445e 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKPropertyTransferServer.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKPropertyTransferServer.java
@@ -30,49 +30,44 @@ import org.apache.log4j.Logger;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestZKPropertyTransferServer extends ZkStandAloneCMTestBaseWithPropertyServerCheck
-{
-  private static Logger LOG =
-      Logger.getLogger(TestZKPropertyTransferServer.class);
+public class TestZKPropertyTransferServer extends ZkStandAloneCMTestBaseWithPropertyServerCheck {
+  private static Logger LOG = Logger.getLogger(TestZKPropertyTransferServer.class);
 
   @Test
-  public void TestControllerChange() throws Exception
-  {
+  public void TestControllerChange() throws Exception {
     String controllerName = CONTROLLER_PREFIX + "_0";
     _startCMResultMap.get(controllerName)._manager.disconnect();
-    
+
     Thread.sleep(1000);
-    
+
     // kill controller, participant should not know about the svc url
-    for (int i = 0; i < NODE_NR; i++)
-    {
+    for (int i = 0; i < NODE_NR; i++) {
       String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
-      HelixDataAccessor accessor = _startCMResultMap.get(instanceName)._manager.getHelixDataAccessor();
+      HelixDataAccessor accessor =
+          _startCMResultMap.get(instanceName)._manager.getHelixDataAccessor();
       ZKHelixDataAccessor zkAccessor = (ZKHelixDataAccessor) accessor;
-      Assert.assertTrue(zkAccessor._zkPropertyTransferSvcUrl == null || zkAccessor._zkPropertyTransferSvcUrl.equals(""));
+      Assert.assertTrue(zkAccessor._zkPropertyTransferSvcUrl == null
+          || zkAccessor._zkPropertyTransferSvcUrl.equals(""));
     }
     _startCMResultMap.get(controllerName)._thread.interrupt();
     _startCMResultMap.remove(controllerName);
-    
+
     StartCMResult startResult =
-        TestHelper.startController(CLUSTER_NAME,
-                                   controllerName,
-                                   ZK_ADDR,
-                                   HelixControllerMain.STANDALONE);
+        TestHelper.startController(CLUSTER_NAME, controllerName, ZK_ADDR,
+            HelixControllerMain.STANDALONE);
     _startCMResultMap.put(controllerName, startResult);
-    
+
     Thread.sleep(1000);
-    
+
     // create controller again, the svc url is notified to the participants
-    for (int i = 0; i < NODE_NR; i++)
-    {
+    for (int i = 0; i < NODE_NR; i++) {
       String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
-      HelixDataAccessor accessor = _startCMResultMap.get(instanceName)._manager.getHelixDataAccessor();
+      HelixDataAccessor accessor =
+          _startCMResultMap.get(instanceName)._manager.getHelixDataAccessor();
       ZKHelixDataAccessor zkAccessor = (ZKHelixDataAccessor) accessor;
-      Assert.assertTrue(zkAccessor._zkPropertyTransferSvcUrl.equals(ZKPropertyTransferServer.getInstance().getWebserviceUrl()));
+      Assert.assertTrue(zkAccessor._zkPropertyTransferSvcUrl.equals(ZKPropertyTransferServer
+          .getInstance().getWebserviceUrl()));
     }
   }
-  
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKUtil.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKUtil.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKUtil.java
index 676b0ec..f7dcb85 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKUtil.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZKUtil.java
@@ -35,21 +35,17 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-
-public class TestZKUtil extends ZkUnitTestBase
-{
+public class TestZKUtil extends ZkUnitTestBase {
   private static Logger LOG = Logger.getLogger(TestZKUtil.class);
 
   String clusterName = CLUSTER_PREFIX + "_" + getShortClassName();
   ZkClient _zkClient;
 
   @BeforeClass()
-  public void beforeClass() throws IOException, Exception
-  {
+  public void beforeClass() throws IOException, Exception {
     _zkClient = new ZkClient(ZK_ADDR);
     _zkClient.setZkSerializer(new ZNRecordSerializer());
-    if (_zkClient.exists("/" + clusterName))
-    {
+    if (_zkClient.exists("/" + clusterName)) {
       _zkClient.deleteRecursive("/" + clusterName);
     }
 
@@ -68,26 +64,24 @@ public class TestZKUtil extends ZkUnitTestBase
   }
 
   @AfterClass()
-  public void afterClass()
-  {
+  public void afterClass() {
     _zkClient.close();
   }
 
   @Test()
-  public void testIsClusterSetup()
-  {
+  public void testIsClusterSetup() {
     boolean result = ZKUtil.isClusterSetup(clusterName, _zkClient);
     AssertJUnit.assertTrue(result);
   }
 
   @Test()
-  public void testChildrenOperations()
-  {
+  public void testChildrenOperations() {
     List<ZNRecord> list = new ArrayList<ZNRecord>();
     list.add(new ZNRecord("id1"));
     list.add(new ZNRecord("id2"));
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString());
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString());
     ZKUtil.createChildren(_zkClient, path, list);
     list = ZKUtil.getChildren(_zkClient, path);
     AssertJUnit.assertEquals(2, list.size());
@@ -101,10 +95,10 @@ public class TestZKUtil extends ZkUnitTestBase
   }
 
   @Test()
-  public void testUpdateIfExists()
-  {
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString(), "id3");
+  public void testUpdateIfExists() {
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString(), "id3");
     ZNRecord record = new ZNRecord("id4");
     ZKUtil.updateIfExists(_zkClient, path, record, false);
     AssertJUnit.assertFalse(_zkClient.exists(path));
@@ -116,10 +110,10 @@ public class TestZKUtil extends ZkUnitTestBase
   }
 
   @Test()
-  public void testSubtract()
-  {
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString(), "id5");
+  public void testSubtract() {
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString(), "id5");
     ZNRecord record = new ZNRecord("id5");
     record.setSimpleField("key1", "value1");
     _zkClient.createPersistent(path, record);
@@ -129,18 +123,18 @@ public class TestZKUtil extends ZkUnitTestBase
   }
 
   @Test()
-  public void testNullChildren()
-  {
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString(), "id6");
+  public void testNullChildren() {
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString(), "id6");
     ZKUtil.createChildren(_zkClient, path, (List<ZNRecord>) null);
   }
 
   @Test()
-  public void testCreateOrUpdate()
-  {
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString(), "id7");
+  public void testCreateOrUpdate() {
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString(), "id7");
     ZNRecord record = new ZNRecord("id7");
     ZKUtil.createOrUpdate(_zkClient, path, record, true, true);
     record = _zkClient.<ZNRecord> readData(path);
@@ -148,10 +142,10 @@ public class TestZKUtil extends ZkUnitTestBase
   }
 
   @Test()
-  public void testCreateOrReplace()
-  {
-    String path = PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
-        ConfigScopeProperty.PARTICIPANT.toString(), "id8");
+  public void testCreateOrReplace() {
+    String path =
+        PropertyPathConfig.getPath(PropertyType.CONFIGS, clusterName,
+            ConfigScopeProperty.PARTICIPANT.toString(), "id8");
     ZNRecord record = new ZNRecord("id8");
     ZKUtil.createOrReplace(_zkClient, path, record, true);
     record = _zkClient.<ZNRecord> readData(path);


Mime
View raw message