helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zzh...@apache.org
Subject [17/51] [partial] [HELIX-198] Unify helix code style, rb=13710
Date Wed, 21 Aug 2013 20:43:30 GMT
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/alerts/TestOperators.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/alerts/TestOperators.java b/helix-core/src/test/java/org/apache/helix/alerts/TestOperators.java
index b34a89f..2d54a27 100644
--- a/helix-core/src/test/java/org/apache/helix/alerts/TestOperators.java
+++ b/helix-core/src/test/java/org/apache/helix/alerts/TestOperators.java
@@ -31,263 +31,299 @@ import org.testng.AssertJUnit;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+public class TestOperators {
 
+  SumOperator _sumOp;
+  SumEachOperator _sumEachOp;
 
-public class TestOperators {
-	
-	SumOperator _sumOp;
-	SumEachOperator _sumEachOp;
-	
-	@BeforeMethod (groups = {"unitTest"})
-	public void setup()
-	{
-		_sumOp = new SumOperator();
-		_sumEachOp = new SumEachOperator();
-	}
-	
-	
-	@Test (groups = {"unitTest"})
-	public void testTwoNulls()
-	{
-		Tuple<String> tup1 = null;
-		Tuple<String> tup2 = null;
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals(null, resultTup);
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testOneNullLeft()
-	{
-		Tuple<String> tup1 = null;
-		Tuple<String> tup2 = new Tuple<String>();
-		tup2.add("1.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals("1.0", resultTup.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testOneNullRight()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = null;
-		tup1.add("1.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals("1.0", resultTup.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testTwoSingeltons()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = new Tuple<String>();
-		tup1.add("1.0");
-		tup2.add("2.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals("3.0", resultTup.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testThreeSingeltons()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = new Tuple<String>();
-		Tuple<String> tup3 = new Tuple<String>();
-		tup1.add("1.0");
-		tup2.add("2.0");
-		tup3.add("3.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		tup3List.add(tup3);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		tupsList.add(tup3List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals("6.0", resultTup.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testThreeTriples()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = new Tuple<String>();
-		Tuple<String> tup3 = new Tuple<String>();
-		tup1.add("1.0"); tup1.add("2.0"); tup1.add("3.0");
-		tup2.add("4.0"); tup2.add("5.0"); tup2.add("6.0");
-		tup3.add("7.0"); tup3.add("8.0"); tup3.add("9.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		tup3List.add(tup3);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		tupsList.add(tup3List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		AssertJUnit.assertEquals("12.0,15.0,18.0", resultTup.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testThreeTriplesOneMissing()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = new Tuple<String>();
-		Tuple<String> tup3 = new Tuple<String>();
-		tup1.add("1.0"); tup1.add("2.0"); tup1.add("3.0");
-		tup2.add("5.0"); tup2.add("6.0");
-		tup3.add("7.0"); tup3.add("8.0"); tup3.add("9.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1);
-		tup2List.add(tup2);
-		tup3List.add(tup3);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		tupsList.add(tup3List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup = resultIter.next();
-		//tuple 2 missing 1 entry, other 2 get bumped to right
-		AssertJUnit.assertEquals("8.0,15.0,18.0", resultTup.toString());
-	}
+  @BeforeMethod(groups = {
+    "unitTest"
+  })
+  public void setup() {
+    _sumOp = new SumOperator();
+    _sumEachOp = new SumEachOperator();
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testTwoNulls() {
+    Tuple<String> tup1 = null;
+    Tuple<String> tup2 = null;
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals(null, resultTup);
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testOneNullLeft() {
+    Tuple<String> tup1 = null;
+    Tuple<String> tup2 = new Tuple<String>();
+    tup2.add("1.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals("1.0", resultTup.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testOneNullRight() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = null;
+    tup1.add("1.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals("1.0", resultTup.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testTwoSingeltons() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = new Tuple<String>();
+    tup1.add("1.0");
+    tup2.add("2.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals("3.0", resultTup.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testThreeSingeltons() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = new Tuple<String>();
+    Tuple<String> tup3 = new Tuple<String>();
+    tup1.add("1.0");
+    tup2.add("2.0");
+    tup3.add("3.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    tup3List.add(tup3);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    tupsList.add(tup3List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals("6.0", resultTup.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testThreeTriples() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = new Tuple<String>();
+    Tuple<String> tup3 = new Tuple<String>();
+    tup1.add("1.0");
+    tup1.add("2.0");
+    tup1.add("3.0");
+    tup2.add("4.0");
+    tup2.add("5.0");
+    tup2.add("6.0");
+    tup3.add("7.0");
+    tup3.add("8.0");
+    tup3.add("9.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    tup3List.add(tup3);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    tupsList.add(tup3List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    AssertJUnit.assertEquals("12.0,15.0,18.0", resultTup.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testThreeTriplesOneMissing() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = new Tuple<String>();
+    Tuple<String> tup3 = new Tuple<String>();
+    tup1.add("1.0");
+    tup1.add("2.0");
+    tup1.add("3.0");
+    tup2.add("5.0");
+    tup2.add("6.0");
+    tup3.add("7.0");
+    tup3.add("8.0");
+    tup3.add("9.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1);
+    tup2List.add(tup2);
+    tup3List.add(tup3);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    tupsList.add(tup3List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup = resultIter.next();
+    // tuple 2 missing 1 entry, other 2 get bumped to right
+    AssertJUnit.assertEquals("8.0,15.0,18.0", resultTup.toString());
+  }
+
+  // test multiple rows
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testThreeTriplesOneMissingTwoRows() {
+    Tuple<String> tup1Dot1 = new Tuple<String>();
+    Tuple<String> tup2Dot1 = new Tuple<String>();
+    Tuple<String> tup3Dot1 = new Tuple<String>();
+    Tuple<String> tup1Dot2 = new Tuple<String>();
+    Tuple<String> tup2Dot2 = new Tuple<String>();
+    Tuple<String> tup3Dot2 = new Tuple<String>();
+    tup1Dot1.add("1.0");
+    tup1Dot1.add("2.0");
+    tup1Dot1.add("3.0");
+    tup2Dot1.add("5.0");
+    tup2Dot1.add("6.0");
+    tup3Dot1.add("7.0");
+    tup3Dot1.add("8.0");
+    tup3Dot1.add("9.0");
+    tup1Dot2.add("10.0");
+    tup1Dot2.add("11.0");
+    tup1Dot2.add("12.0");
+    tup2Dot2.add("13.0");
+    tup2Dot2.add("14.0");
+    tup2Dot2.add("15.0");
+    tup3Dot2.add("16.0");
+    tup3Dot2.add("17.0");
+    tup3Dot2.add("18.0");
+    List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
+    tup1List.add(tup1Dot1);
+    tup2List.add(tup2Dot1);
+    tup3List.add(tup3Dot1);
+    tup1List.add(tup1Dot2);
+    tup2List.add(tup2Dot2);
+    tup3List.add(tup3Dot2);
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(tup1List.iterator());
+    tupsList.add(tup2List.iterator());
+    tupsList.add(tup3List.iterator());
+    List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
+    AssertJUnit.assertEquals(1, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup1 = resultIter.next();
+    // tuple 2 missing 1 entry, other 2 get bumped to right
+    AssertJUnit.assertEquals("8.0,15.0,18.0", resultTup1.toString());
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup2 = resultIter.next();
+    AssertJUnit.assertEquals("39.0,42.0,45.0", resultTup2.toString());
+  }
+
+  @Test(groups = {
+    "unitTest"
+  })
+  public void testSumAll() {
+    Tuple<String> tup1 = new Tuple<String>();
+    Tuple<String> tup2 = new Tuple<String>();
+    Tuple<String> tup3 = new Tuple<String>();
+    Tuple<String> tup4 = new Tuple<String>();
+    Tuple<String> tup5 = new Tuple<String>();
+    Tuple<String> tup6 = new Tuple<String>();
+    tup1.add("1.0");
+    tup2.add("2.0");
+    tup3.add("3.0");
+    tup4.add("4.0");
+    tup5.add("5.0");
+    tup6.add("6.0");
+    List<Tuple<String>> list1 = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> list2 = new ArrayList<Tuple<String>>();
+    List<Tuple<String>> list3 = new ArrayList<Tuple<String>>();
+    list1.add(tup1);
+    list1.add(tup4);
+    list2.add(tup2);
+    list2.add(tup5);
+    list3.add(tup3);
+    list3.add(tup6);
 
-	//test multiple rows
-	@Test (groups = {"unitTest"})
-	public void testThreeTriplesOneMissingTwoRows()
-	{
-		Tuple<String> tup1Dot1 = new Tuple<String>();
-		Tuple<String> tup2Dot1 = new Tuple<String>();
-		Tuple<String> tup3Dot1 = new Tuple<String>();
-		Tuple<String> tup1Dot2 = new Tuple<String>();
-		Tuple<String> tup2Dot2 = new Tuple<String>();
-		Tuple<String> tup3Dot2 = new Tuple<String>();
-		tup1Dot1.add("1.0"); tup1Dot1.add("2.0"); tup1Dot1.add("3.0");
-		tup2Dot1.add("5.0"); tup2Dot1.add("6.0");
-		tup3Dot1.add("7.0"); tup3Dot1.add("8.0"); tup3Dot1.add("9.0");
-		tup1Dot2.add("10.0"); tup1Dot2.add("11.0"); tup1Dot2.add("12.0");
-		tup2Dot2.add("13.0"); tup2Dot2.add("14.0"); tup2Dot2.add("15.0");
-		tup3Dot2.add("16.0"); tup3Dot2.add("17.0"); tup3Dot2.add("18.0");
-		List<Tuple<String>> tup1List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup2List = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> tup3List = new ArrayList<Tuple<String>>();
-		tup1List.add(tup1Dot1);
-		tup2List.add(tup2Dot1);
-		tup3List.add(tup3Dot1);
-		tup1List.add(tup1Dot2);
-		tup2List.add(tup2Dot2);
-		tup3List.add(tup3Dot2);
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(tup1List.iterator());
-		tupsList.add(tup2List.iterator());
-		tupsList.add(tup3List.iterator());
-		List<Iterator<Tuple<String>>> result = _sumOp.execute(tupsList);
-		AssertJUnit.assertEquals(1, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup1 = resultIter.next();
-		//tuple 2 missing 1 entry, other 2 get bumped to right
-		AssertJUnit.assertEquals("8.0,15.0,18.0", resultTup1.toString());
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup2 = resultIter.next();
-		AssertJUnit.assertEquals("39.0,42.0,45.0", resultTup2.toString());
-	}
-	
-	@Test (groups = {"unitTest"})
-	public void testSumAll()
-	{
-		Tuple<String> tup1 = new Tuple<String>();
-		Tuple<String> tup2 = new Tuple<String>();
-		Tuple<String> tup3 = new Tuple<String>();
-		Tuple<String> tup4 = new Tuple<String>();
-		Tuple<String> tup5 = new Tuple<String>();
-		Tuple<String> tup6 = new Tuple<String>();
-		tup1.add("1.0"); tup2.add("2.0"); tup3.add("3.0");
-		tup4.add("4.0"); tup5.add("5.0"); tup6.add("6.0");
-		List<Tuple<String>> list1 = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> list2 = new ArrayList<Tuple<String>>();
-		List<Tuple<String>> list3 = new ArrayList<Tuple<String>>();
-		list1.add(tup1); list1.add(tup4); 
-		list2.add(tup2); list2.add(tup5);
-		list3.add(tup3); list3.add(tup6);
-		
-		List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
-		tupsList.add(list1.iterator());
-		tupsList.add(list2.iterator());
-		tupsList.add(list3.iterator());
-		List<Iterator<Tuple<String>>> result = _sumEachOp.execute(tupsList);
-		AssertJUnit.assertEquals(3, result.size()); //should be just 1 iter
-		Iterator<Tuple<String>> resultIter = result.get(0);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		Tuple<String>resultTup1 = resultIter.next();
-		AssertJUnit.assertEquals("5.0", resultTup1.toString());
-		resultIter = result.get(1);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		resultTup1 = resultIter.next();
-		AssertJUnit.assertEquals("7.0", resultTup1.toString());
-		resultIter = result.get(2);
-		AssertJUnit.assertTrue(resultIter.hasNext());
-		resultTup1 = resultIter.next();
-		AssertJUnit.assertEquals("9.0", resultTup1.toString());
-	}
+    List<Iterator<Tuple<String>>> tupsList = new ArrayList<Iterator<Tuple<String>>>();
+    tupsList.add(list1.iterator());
+    tupsList.add(list2.iterator());
+    tupsList.add(list3.iterator());
+    List<Iterator<Tuple<String>>> result = _sumEachOp.execute(tupsList);
+    AssertJUnit.assertEquals(3, result.size()); // should be just 1 iter
+    Iterator<Tuple<String>> resultIter = result.get(0);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    Tuple<String> resultTup1 = resultIter.next();
+    AssertJUnit.assertEquals("5.0", resultTup1.toString());
+    resultIter = result.get(1);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    resultTup1 = resultIter.next();
+    AssertJUnit.assertEquals("7.0", resultTup1.toString());
+    resultIter = result.get(2);
+    AssertJUnit.assertTrue(resultIter.hasNext());
+    resultTup1 = resultIter.next();
+    AssertJUnit.assertEquals("9.0", resultTup1.toString());
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/alerts/TestStatsMatch.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/alerts/TestStatsMatch.java b/helix-core/src/test/java/org/apache/helix/alerts/TestStatsMatch.java
index 3a02e07..094f347 100644
--- a/helix-core/src/test/java/org/apache/helix/alerts/TestStatsMatch.java
+++ b/helix-core/src/test/java/org/apache/helix/alerts/TestStatsMatch.java
@@ -26,84 +26,82 @@ import org.testng.AssertJUnit;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
 @Test
 public class TestStatsMatch {
 
-	@Test
-	  public void testExactMatch()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition10.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatExactMatch(persistedStatName, incomingStatName));
-	  }
-	
-	@Test
-	  public void testSingleWildcardMatch()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName));
-	  }
-	
-	@Test
-	  public void testDoubleWildcardMatch()
-	  {
-	    
-	    String persistedStatName = "window(5)(db*.partition*.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName));
-	  }
-	
-	@Test
-	  public void testWildcardMatchNoWildcard()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition10.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName));
-	  }
-	
-	@Test
-	  public void testWildcardMatchTooManyFields()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
-	    String incomingStatName = "dbFoo.tableBar.partition10.latency";
-	    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName));
-	  }
-	
-	@Test
-	  public void testWildcardMatchTooFewFields()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
-	    String incomingStatName = "dbFoo.latency";
-	    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName));
-	  }
-	
-
-	@Test
-	  public void testBadWildcardRepeated()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.partition**4.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    boolean match = ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName);
-	    
-	    AssertJUnit.assertFalse(match);
-	  }
-	
-	@Test
-	  public void testBadWildcardNotAtEnd()
-	  {
-	    
-	    String persistedStatName = "window(5)(dbFoo.*partition.latency)";
-	    String incomingStatName = "dbFoo.partition10.latency";
-	    boolean match = ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName);
-	    
-	    AssertJUnit.assertFalse(match);
-	  }
+  @Test
+  public void testExactMatch() {
+
+    String persistedStatName = "window(5)(dbFoo.partition10.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatExactMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testSingleWildcardMatch() {
+
+    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testDoubleWildcardMatch() {
+
+    String persistedStatName = "window(5)(db*.partition*.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    AssertJUnit.assertTrue(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testWildcardMatchNoWildcard() {
+
+    String persistedStatName = "window(5)(dbFoo.partition10.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testWildcardMatchTooManyFields() {
+
+    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
+    String incomingStatName = "dbFoo.tableBar.partition10.latency";
+    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testWildcardMatchTooFewFields() {
+
+    String persistedStatName = "window(5)(dbFoo.partition*.latency)";
+    String incomingStatName = "dbFoo.latency";
+    AssertJUnit.assertFalse(ExpressionParser.isIncomingStatWildcardMatch(persistedStatName,
+        incomingStatName));
+  }
+
+  @Test
+  public void testBadWildcardRepeated() {
+
+    String persistedStatName = "window(5)(dbFoo.partition**4.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    boolean match =
+        ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName);
+
+    AssertJUnit.assertFalse(match);
+  }
+
+  @Test
+  public void testBadWildcardNotAtEnd() {
+
+    String persistedStatName = "window(5)(dbFoo.*partition.latency)";
+    String incomingStatName = "dbFoo.partition10.latency";
+    boolean match =
+        ExpressionParser.isIncomingStatWildcardMatch(persistedStatName, incomingStatName);
+
+    AssertJUnit.assertFalse(match);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java b/helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java
index f2e49e5..64e378e 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java
@@ -44,58 +44,47 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 
-
-public class BaseStageTest
-{
+public class BaseStageTest {
   protected HelixManager manager;
   protected HelixDataAccessor accessor;
   protected ClusterEvent event;
 
   @BeforeClass()
-  public void beforeClass()
-  {
+  public void beforeClass() {
     String className = this.getClass().getName();
-    System.out.println("START " + className.substring(className.lastIndexOf('.') + 1)
-                       + " at "+ new Date(System.currentTimeMillis()));
+    System.out.println("START " + className.substring(className.lastIndexOf('.') + 1) + " at "
+        + new Date(System.currentTimeMillis()));
   }
 
   @AfterClass()
-  public void afterClass()
-  {
+  public void afterClass() {
     String className = this.getClass().getName();
-    System.out.println("END " + className.substring(className.lastIndexOf('.') + 1)
-                       + " at "+ new Date(System.currentTimeMillis()));
+    System.out.println("END " + className.substring(className.lastIndexOf('.') + 1) + " at "
+        + new Date(System.currentTimeMillis()));
   }
 
   @BeforeMethod()
-  public void setup()
-  {
+  public void setup() {
     String clusterName = "testCluster-" + UUID.randomUUID().toString();
     manager = new Mocks.MockManager(clusterName);
     accessor = manager.getHelixDataAccessor();
     event = new ClusterEvent("sampleEvent");
   }
 
-  protected List<IdealState> setupIdealState(int nodes, String[] resources,
-                                             int partitions, int replicas,
-                                             RebalanceMode rebalanceMode)
-  {
+  protected List<IdealState> setupIdealState(int nodes, String[] resources, int partitions,
+      int replicas, RebalanceMode rebalanceMode) {
     List<IdealState> idealStates = new ArrayList<IdealState>();
     List<String> instances = new ArrayList<String>();
-    for (int i = 0; i < nodes; i++)
-    {
+    for (int i = 0; i < nodes; i++) {
       instances.add("localhost_" + i);
     }
 
-    for (int i = 0; i < resources.length; i++)
-    {
+    for (int i = 0; i < resources.length; i++) {
       String resourceName = resources[i];
       ZNRecord record = new ZNRecord(resourceName);
-      for (int p = 0; p < partitions; p++)
-      {
+      for (int p = 0; p < partitions; p++) {
         List<String> value = new ArrayList<String>();
-        for (int r = 0; r < replicas; r++)
-        {
+        for (int r = 0; r < replicas; r++) {
           value.add("localhost_" + (p + r + 1) % nodes);
         }
         record.setListField(resourceName + "_" + p, value);
@@ -106,7 +95,7 @@ public class BaseStageTest
       idealState.setNumPartitions(partitions);
       idealStates.add(idealState);
 
-//      System.out.println(idealState);
+      // System.out.println(idealState);
 
       Builder keyBuilder = accessor.keyBuilder();
 
@@ -115,54 +104,47 @@ public class BaseStageTest
     return idealStates;
   }
 
-  protected void setupLiveInstances(int numLiveInstances)
-  {
+  protected void setupLiveInstances(int numLiveInstances) {
     // setup liveInstances
-    for (int i = 0; i < numLiveInstances; i++)
-    {
+    for (int i = 0; i < numLiveInstances; i++) {
       LiveInstance liveInstance = new LiveInstance("localhost_" + i);
       liveInstance.setSessionId("session_" + i);
-      
+
       Builder keyBuilder = accessor.keyBuilder();
       accessor.setProperty(keyBuilder.liveInstance("localhost_" + i), liveInstance);
     }
   }
 
-  protected void runStage(ClusterEvent event, Stage stage)
-  {
+  protected void runStage(ClusterEvent event, Stage stage) {
     event.addAttribute("helixmanager", manager);
     StageContext context = new StageContext();
     stage.init(context);
     stage.preProcess();
-    try
-    {
+    try {
       stage.process(event);
-    } catch (Exception e)
-    {
+    } catch (Exception e) {
       e.printStackTrace();
     }
     stage.postProcess();
   }
 
-  protected void setupStateModel()
-  {
-    ZNRecord masterSlave = new StateModelConfigGenerator()
-        .generateConfigForMasterSlave();
-    
+  protected void setupStateModel() {
+    ZNRecord masterSlave = new StateModelConfigGenerator().generateConfigForMasterSlave();
+
     Builder keyBuilder = accessor.keyBuilder();
-    accessor.setProperty(keyBuilder.stateModelDef(masterSlave.getId()), new StateModelDefinition(masterSlave));
-    
-    ZNRecord leaderStandby = new StateModelConfigGenerator()
-        .generateConfigForLeaderStandby();
-    accessor.setProperty(keyBuilder.stateModelDef(leaderStandby.getId()), new StateModelDefinition(leaderStandby));
-
-    ZNRecord onlineOffline = new StateModelConfigGenerator()
-        .generateConfigForOnlineOffline();
-    accessor.setProperty(keyBuilder.stateModelDef(onlineOffline.getId()), new StateModelDefinition(onlineOffline));
+    accessor.setProperty(keyBuilder.stateModelDef(masterSlave.getId()), new StateModelDefinition(
+        masterSlave));
+
+    ZNRecord leaderStandby = new StateModelConfigGenerator().generateConfigForLeaderStandby();
+    accessor.setProperty(keyBuilder.stateModelDef(leaderStandby.getId()), new StateModelDefinition(
+        leaderStandby));
+
+    ZNRecord onlineOffline = new StateModelConfigGenerator().generateConfigForOnlineOffline();
+    accessor.setProperty(keyBuilder.stateModelDef(onlineOffline.getId()), new StateModelDefinition(
+        onlineOffline));
   }
 
-  protected Map<String, Resource> getResourceMap()
-  {
+  protected Map<String, Resource> getResourceMap() {
     Map<String, Resource> resourceMap = new HashMap<String, Resource>();
     Resource testResource = new Resource("testResourceName");
     testResource.setStateModelDefRef("MasterSlave");

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/DummyClusterManager.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/DummyClusterManager.java b/helix-core/src/test/java/org/apache/helix/controller/stages/DummyClusterManager.java
index 52f7a34..26da8ee 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/DummyClusterManager.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/DummyClusterManager.java
@@ -45,241 +45,208 @@ import org.apache.helix.model.HelixConfigScope.ConfigScopeProperty;
 import org.apache.helix.participant.StateMachineEngine;
 import org.apache.helix.store.zk.ZkHelixPropertyStore;
 
-public class DummyClusterManager implements HelixManager
-{
+public class DummyClusterManager implements HelixManager {
   HelixDataAccessor _accessor;
   String _clusterName;
   String _sessionId;
 
-  public DummyClusterManager(String clusterName, HelixDataAccessor accessor)
-  {
+  public DummyClusterManager(String clusterName, HelixDataAccessor accessor) {
     _clusterName = clusterName;
     _accessor = accessor;
     _sessionId = "session_" + clusterName;
   }
 
   @Override
-  public void connect() throws Exception
-  {
+  public void connect() throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public boolean isConnected()
-  {
+  public boolean isConnected() {
     // TODO Auto-generated method stub
     return false;
   }
 
   @Override
-  public void disconnect()
-  {
+  public void disconnect() {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void addIdealStateChangeListener(IdealStateChangeListener listener) throws Exception
-  {
+  public void addIdealStateChangeListener(IdealStateChangeListener listener) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void addLiveInstanceChangeListener(LiveInstanceChangeListener listener) throws Exception
-  {
+  public void addLiveInstanceChangeListener(LiveInstanceChangeListener listener) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void addConfigChangeListener(ConfigChangeListener listener) throws Exception
-  {
+  public void addConfigChangeListener(ConfigChangeListener listener) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void addMessageListener(MessageListener listener, String instanceName) throws Exception
-  {
+  public void addMessageListener(MessageListener listener, String instanceName) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
   public void addCurrentStateChangeListener(CurrentStateChangeListener listener,
-                                            String instanceName,
-                                            String sessionId) throws Exception
-  {
+      String instanceName, String sessionId) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void addExternalViewChangeListener(ExternalViewChangeListener listener) throws Exception
-  {
+  public void addExternalViewChangeListener(ExternalViewChangeListener listener) throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public boolean removeListener(PropertyKey key, Object listener)
-  {
+  public boolean removeListener(PropertyKey key, Object listener) {
     // TODO Auto-generated method stub
     return false;
   }
 
   @Override
-  public String getClusterName()
-  {
+  public String getClusterName() {
     return _clusterName;
   }
 
   @Override
-  public String getInstanceName()
-  {
+  public String getInstanceName() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public String getSessionId()
-  {
+  public String getSessionId() {
     return _sessionId;
   }
 
   @Override
-  public long getLastNotificationTime()
-  {
+  public long getLastNotificationTime() {
     // TODO Auto-generated method stub
     return 0;
   }
 
   @Override
-  public void addControllerListener(ControllerChangeListener listener)
-  {
+  public void addControllerListener(ControllerChangeListener listener) {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public HelixAdmin getClusterManagmentTool()
-  {
+  public HelixAdmin getClusterManagmentTool() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public ClusterMessagingService getMessagingService()
-  {
+  public ClusterMessagingService getMessagingService() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public ParticipantHealthReportCollector getHealthReportCollector()
-  {
+  public ParticipantHealthReportCollector getHealthReportCollector() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public InstanceType getInstanceType()
-  {
+  public InstanceType getInstanceType() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public String getVersion()
-  {
+  public String getVersion() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public void addHealthStateChangeListener(HealthStateChangeListener listener,
-                                           String instanceName) throws Exception
-  {
+  public void addHealthStateChangeListener(HealthStateChangeListener listener, String instanceName)
+      throws Exception {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public StateMachineEngine getStateMachineEngine()
-  {
+  public StateMachineEngine getStateMachineEngine() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public boolean isLeader()
-  {
+  public boolean isLeader() {
     // TODO Auto-generated method stub
     return false;
   }
 
   @Override
-  public ConfigAccessor getConfigAccessor()
-  {
+  public ConfigAccessor getConfigAccessor() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public void startTimerTasks()
-  {
+  public void startTimerTasks() {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void stopTimerTasks()
-  {
+  public void stopTimerTasks() {
     // TODO Auto-generated method stub
 
   }
 
   @Override
-  public HelixDataAccessor getHelixDataAccessor()
-  {
+  public HelixDataAccessor getHelixDataAccessor() {
     return _accessor;
   }
 
   @Override
-  public void addPreConnectCallback(PreConnectCallback callback)
-  {
+  public void addPreConnectCallback(PreConnectCallback callback) {
     // TODO Auto-generated method stub
-    
+
   }
 
   @Override
-  public ZkHelixPropertyStore<ZNRecord> getHelixPropertyStore()
-  {
+  public ZkHelixPropertyStore<ZNRecord> getHelixPropertyStore() {
     // TODO Auto-generated method stub
     return null;
   }
-  
+
   @Override
-  public void addInstanceConfigChangeListener(InstanceConfigChangeListener listener) throws Exception {
-  	// TODO Auto-generated method stub
+  public void addInstanceConfigChangeListener(InstanceConfigChangeListener listener)
+      throws Exception {
+    // TODO Auto-generated method stub
 
   }
 
   @Override
   public void addConfigChangeListener(ScopedConfigChangeListener listener, ConfigScopeProperty scope)
-          throws Exception {
-  	// TODO Auto-generated method stub
+      throws Exception {
+    // TODO Auto-generated method stub
 
   }
 
   @Override
-  public void setLiveInstanceInfoProvider(
-      LiveInstanceInfoProvider liveInstanceInfoProvider)
-  {
+  public void setLiveInstanceInfoProvider(LiveInstanceInfoProvider liveInstanceInfoProvider) {
     // TODO Auto-generated method stub
-    
+
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleCalcStageCompatibility.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleCalcStageCompatibility.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleCalcStageCompatibility.java
index ba0d3d7..33570a0 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleCalcStageCompatibility.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleCalcStageCompatibility.java
@@ -44,31 +44,29 @@ public class TestBestPossibleCalcStageCompatibility extends BaseStageTest {
     System.out.println("START TestBestPossibleStateCalcStage at "
         + new Date(System.currentTimeMillis()));
 
-    String[] resources = new String[]{ "testResourceName" };
+    String[] resources = new String[] {
+      "testResourceName"
+    };
     setupIdealStateDeprecated(5, resources, 10, 1, IdealStateModeProperty.AUTO);
     setupLiveInstances(5);
     setupStateModel();
 
     Map<String, Resource> resourceMap = getResourceMap();
     CurrentStateOutput currentStateOutput = new CurrentStateOutput();
-    event.addAttribute(AttributeName.RESOURCES.toString(),
-        resourceMap);
-    event.addAttribute(AttributeName.CURRENT_STATE.toString(),
-        currentStateOutput);
+    event.addAttribute(AttributeName.RESOURCES.toString(), resourceMap);
+    event.addAttribute(AttributeName.CURRENT_STATE.toString(), currentStateOutput);
 
     ReadClusterDataStage stage1 = new ReadClusterDataStage();
     runStage(event, stage1);
     BestPossibleStateCalcStage stage2 = new BestPossibleStateCalcStage();
     runStage(event, stage2);
 
-    BestPossibleStateOutput output = event
-        .getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
+    BestPossibleStateOutput output =
+        event.getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
     for (int p = 0; p < 5; p++) {
       Partition resource = new Partition("testResourceName_" + p);
-      AssertJUnit.assertEquals(
-          "MASTER",
-          output.getInstanceStateMap("testResourceName", resource).get(
-              "localhost_" + (p + 1) % 5));
+      AssertJUnit.assertEquals("MASTER", output.getInstanceStateMap("testResourceName", resource)
+          .get("localhost_" + (p + 1) % 5));
     }
     System.out.println("END TestBestPossibleStateCalcStage at "
         + new Date(System.currentTimeMillis()));
@@ -79,30 +77,29 @@ public class TestBestPossibleCalcStageCompatibility extends BaseStageTest {
     System.out.println("START TestBestPossibleStateCalcStage at "
         + new Date(System.currentTimeMillis()));
 
-    String[] resources = new String[]{ "testResourceName" };
+    String[] resources = new String[] {
+      "testResourceName"
+    };
     setupIdealStateDeprecated(5, resources, 10, 1, IdealStateModeProperty.CUSTOMIZED);
     setupLiveInstances(5);
     setupStateModel();
 
     Map<String, Resource> resourceMap = getResourceMap();
     CurrentStateOutput currentStateOutput = new CurrentStateOutput();
-    event.addAttribute(AttributeName.RESOURCES.toString(),
-        resourceMap);
-    event.addAttribute(AttributeName.CURRENT_STATE.toString(),
-        currentStateOutput);
+    event.addAttribute(AttributeName.RESOURCES.toString(), resourceMap);
+    event.addAttribute(AttributeName.CURRENT_STATE.toString(), currentStateOutput);
 
     ReadClusterDataStage stage1 = new ReadClusterDataStage();
     runStage(event, stage1);
     BestPossibleStateCalcStage stage2 = new BestPossibleStateCalcStage();
     runStage(event, stage2);
 
-    BestPossibleStateOutput output = event
-        .getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
+    BestPossibleStateOutput output =
+        event.getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
     for (int p = 0; p < 5; p++) {
       Partition resource = new Partition("testResourceName_" + p);
-      AssertJUnit.assertNull(
-          output.getInstanceStateMap("testResourceName", resource).get(
-              "localhost_" + (p + 1) % 5));
+      AssertJUnit.assertNull(output.getInstanceStateMap("testResourceName", resource).get(
+          "localhost_" + (p + 1) % 5));
     }
     System.out.println("END TestBestPossibleStateCalcStage at "
         + new Date(System.currentTimeMillis()));
@@ -121,8 +118,7 @@ public class TestBestPossibleCalcStageCompatibility extends BaseStageTest {
       ZNRecord record = new ZNRecord(resourceName);
       for (int p = 0; p < partitions; p++) {
         List<String> value = new ArrayList<String>();
-        for (int r = 0; r < replicas; r++)
-        {
+        for (int r = 0; r < replicas; r++) {
           value.add("localhost_" + (p + r + 1) % nodes);
         }
         record.setListField(resourceName + "_" + p, value);
@@ -133,7 +129,7 @@ public class TestBestPossibleCalcStageCompatibility extends BaseStageTest {
       idealState.setNumPartitions(partitions);
       idealStates.add(idealState);
 
-      //System.out.println(idealState);
+      // System.out.println(idealState);
 
       Builder keyBuilder = accessor.keyBuilder();
 

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleStateCalcStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleStateCalcStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleStateCalcStage.java
index e57f193..82c7b37 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleStateCalcStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestBestPossibleStateCalcStage.java
@@ -33,42 +33,38 @@ import org.apache.helix.model.IdealState.RebalanceMode;
 import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
-
-public class TestBestPossibleStateCalcStage extends BaseStageTest
-{
+public class TestBestPossibleStateCalcStage extends BaseStageTest {
   @Test
-  public void testSimple()
-  {
-  	System.out.println("START TestBestPossibleStateCalcStage at " + new Date(System.currentTimeMillis()));
-//    List<IdealState> idealStates = new ArrayList<IdealState>();
+  public void testSimple() {
+    System.out.println("START TestBestPossibleStateCalcStage at "
+        + new Date(System.currentTimeMillis()));
+    // List<IdealState> idealStates = new ArrayList<IdealState>();
 
-    String[] resources = new String[]{ "testResourceName" };
+    String[] resources = new String[] {
+      "testResourceName"
+    };
     setupIdealState(5, resources, 10, 1, RebalanceMode.SEMI_AUTO);
     setupLiveInstances(5);
     setupStateModel();
 
     Map<String, Resource> resourceMap = getResourceMap();
     CurrentStateOutput currentStateOutput = new CurrentStateOutput();
-    event.addAttribute(AttributeName.RESOURCES.toString(),
-        resourceMap);
-    event.addAttribute(AttributeName.CURRENT_STATE.toString(),
-        currentStateOutput);
+    event.addAttribute(AttributeName.RESOURCES.toString(), resourceMap);
+    event.addAttribute(AttributeName.CURRENT_STATE.toString(), currentStateOutput);
 
     ReadClusterDataStage stage1 = new ReadClusterDataStage();
     runStage(event, stage1);
     BestPossibleStateCalcStage stage2 = new BestPossibleStateCalcStage();
     runStage(event, stage2);
 
-    BestPossibleStateOutput output = event
-        .getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
-    for (int p = 0; p < 5; p++)
-    {
+    BestPossibleStateOutput output =
+        event.getAttribute(AttributeName.BEST_POSSIBLE_STATE.toString());
+    for (int p = 0; p < 5; p++) {
       Partition resource = new Partition("testResourceName_" + p);
-      AssertJUnit.assertEquals(
-          "MASTER",
-          output.getInstanceStateMap("testResourceName", resource).get(
-              "localhost_" + (p + 1) % 5));
+      AssertJUnit.assertEquals("MASTER", output.getInstanceStateMap("testResourceName", resource)
+          .get("localhost_" + (p + 1) % 5));
     }
-    System.out.println("END TestBestPossibleStateCalcStage at " + new Date(System.currentTimeMillis()));
+    System.out.println("END TestBestPossibleStateCalcStage 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/controller/stages/TestClusterEvent.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEvent.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEvent.java
index d9695ca..6cbb539 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEvent.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestClusterEvent.java
@@ -23,10 +23,9 @@ import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
 @Test
-public class TestClusterEvent
-{
+public class TestClusterEvent {
   @Test
-  public void testSimplePutandGet(){
+  public void testSimplePutandGet() {
     ClusterEvent event = new ClusterEvent("name");
     AssertJUnit.assertEquals(event.getName(), "name");
     event.addAttribute("attr1", "value");

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
index d7de733..391d1af 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCompatibilityCheckStage.java
@@ -35,128 +35,109 @@ import org.apache.helix.tools.DefaultIdealStateCalculator;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestCompatibilityCheckStage extends BaseStageTest
-{
-  private void prepare(String controllerVersion, String participantVersion)
-  {
+public class TestCompatibilityCheckStage extends BaseStageTest {
+  private void prepare(String controllerVersion, String participantVersion) {
     prepare(controllerVersion, participantVersion, null);
   }
-  
-  private void prepare(String controllerVersion, String participantVersion, 
-      String minSupportedParticipantVersion)
-  {
-    List<String> instances = Arrays.asList("localhost_0", "localhost_1",
-                                           "localhost_2", "localhost_3", "localhost_4");
+
+  private void prepare(String controllerVersion, String participantVersion,
+      String minSupportedParticipantVersion) {
+    List<String> instances =
+        Arrays.asList("localhost_0", "localhost_1", "localhost_2", "localhost_3", "localhost_4");
     int partitions = 10;
     int replicas = 1;
 
     // set ideal state
     String resourceName = "testResource";
-    ZNRecord record = DefaultIdealStateCalculator.calculateIdealState(
-        instances, partitions, replicas, resourceName, "MASTER", "SLAVE");
+    ZNRecord record =
+        DefaultIdealStateCalculator.calculateIdealState(instances, partitions, replicas,
+            resourceName, "MASTER", "SLAVE");
     IdealState idealState = new IdealState(record);
     idealState.setStateModelDefRef("MasterSlave");
-    
+
     Builder keyBuilder = accessor.keyBuilder();
     accessor.setProperty(keyBuilder.idealStates(resourceName), idealState);
 
     // set live instances
     record = new ZNRecord("localhost_0");
-    if (participantVersion != null)
-    {
+    if (participantVersion != null) {
       record.setSimpleField(LiveInstanceProperty.HELIX_VERSION.toString(), participantVersion);
     }
     LiveInstance liveInstance = new LiveInstance(record);
     liveInstance.setSessionId("session_0");
     accessor.setProperty(keyBuilder.liveInstance("localhost_0"), liveInstance);
 
-    if (controllerVersion != null)
-    {
-      ((Mocks.MockManager)manager).setVersion(controllerVersion);
+    if (controllerVersion != null) {
+      ((Mocks.MockManager) manager).setVersion(controllerVersion);
     }
-    
+
     if (minSupportedParticipantVersion != null) {
       manager.getProperties().getProperties()
-                      .put("minimum_supported_version.participant", 
-                          minSupportedParticipantVersion);
+          .put("minimum_supported_version.participant", minSupportedParticipantVersion);
     }
     event.addAttribute("helixmanager", manager);
     runStage(event, new ReadClusterDataStage());
   }
 
   @Test
-  public void testCompatible()
-  {
+  public void testCompatible() {
     prepare("0.4.0", "0.4.0");
     CompatibilityCheckStage stage = new CompatibilityCheckStage();
     StageContext context = new StageContext();
     stage.init(context);
     stage.preProcess();
-    try
-    {
+    try {
       stage.process(event);
-    }
-    catch (Exception e)
-    {
+    } catch (Exception e) {
       Assert.fail("Should not fail since versions are compatible", e);
     }
     stage.postProcess();
   }
 
   @Test
-  public void testNullParticipantVersion()
-  {
+  public void testNullParticipantVersion() {
     prepare("0.4.0", null);
     CompatibilityCheckStage stage = new CompatibilityCheckStage();
     StageContext context = new StageContext();
     stage.init(context);
     stage.preProcess();
-    try
-    {
+    try {
       stage.process(event);
-    }
-    catch (Exception e)
-    {
-      Assert.fail("Should not fail since compatibility check will be skipped if participant version is null");
+    } catch (Exception e) {
+      Assert
+          .fail("Should not fail since compatibility check will be skipped if participant version is null");
     }
     stage.postProcess();
   }
 
   @Test
-  public void testNullControllerVersion()
-  {
+  public void testNullControllerVersion() {
     prepare(null, "0.4.0");
     CompatibilityCheckStage stage = new CompatibilityCheckStage();
     StageContext context = new StageContext();
     stage.init(context);
     stage.preProcess();
-    try
-    {
+    try {
       stage.process(event);
-    }
-    catch (Exception e)
-    {
-      Assert.fail("Should not fail since compatibility check will be skipped if controller version is null");
+    } catch (Exception e) {
+      Assert
+          .fail("Should not fail since compatibility check will be skipped if controller version is null");
     }
     stage.postProcess();
   }
 
   @Test
-  public void testIncompatible()
-  {
+  public void testIncompatible() {
     prepare("0.6.1-incubating-SNAPSHOT", "0.3.4", "0.4");
     CompatibilityCheckStage stage = new CompatibilityCheckStage();
     StageContext context = new StageContext();
     stage.init(context);
     stage.preProcess();
-    try
-    {
+    try {
       stage.process(event);
-      Assert.fail("Should fail since participant version is less than the minimum participant version supported by controller");
-    }
-    catch (Exception e)
-    {
+      Assert
+          .fail("Should fail since participant version is less than the minimum participant version supported by controller");
+    } catch (Exception e) {
       // OK
     }
     stage.postProcess();

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestCurrentStateComputationStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCurrentStateComputationStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCurrentStateComputationStage.java
index 677f424..7687e18 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestCurrentStateComputationStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestCurrentStateComputationStage.java
@@ -34,29 +34,23 @@ import org.apache.helix.model.Resource;
 import org.testng.AssertJUnit;
 import org.testng.annotations.Test;
 
-
-public class TestCurrentStateComputationStage extends BaseStageTest
-{
+public class TestCurrentStateComputationStage extends BaseStageTest {
 
   @Test
-  public void testEmptyCS()
-  {
+  public void testEmptyCS() {
     Map<String, Resource> resourceMap = getResourceMap();
     event.addAttribute(AttributeName.RESOURCES.toString(), resourceMap);
     CurrentStateComputationStage stage = new CurrentStateComputationStage();
     runStage(event, new ReadClusterDataStage());
     runStage(event, stage);
-    CurrentStateOutput output =
-        event.getAttribute(AttributeName.CURRENT_STATE.toString());
-    AssertJUnit.assertEquals(output.getCurrentStateMap("testResourceName",
-                                                       new Partition("testResourceName_0"))
-                                   .size(),
-                             0);
+    CurrentStateOutput output = event.getAttribute(AttributeName.CURRENT_STATE.toString());
+    AssertJUnit.assertEquals(
+        output.getCurrentStateMap("testResourceName", new Partition("testResourceName_0")).size(),
+        0);
   }
 
   @Test
-  public void testSimpleCS()
-  {
+  public void testSimpleCS() {
     // setup resource
     Map<String, Resource> resourceMap = getResourceMap();
 
@@ -66,12 +60,10 @@ public class TestCurrentStateComputationStage extends BaseStageTest
     CurrentStateComputationStage stage = new CurrentStateComputationStage();
     runStage(event, new ReadClusterDataStage());
     runStage(event, stage);
-    CurrentStateOutput output1 =
-        event.getAttribute(AttributeName.CURRENT_STATE.toString());
-    AssertJUnit.assertEquals(output1.getCurrentStateMap("testResourceName",
-                                                        new Partition("testResourceName_0"))
-                                    .size(),
-                             0);
+    CurrentStateOutput output1 = event.getAttribute(AttributeName.CURRENT_STATE.toString());
+    AssertJUnit.assertEquals(
+        output1.getCurrentStateMap("testResourceName", new Partition("testResourceName_0")).size(),
+        0);
 
     // Add a state transition messages
     Message message = new Message(Message.MessageType.STATE_TRANSITION, "msg1");
@@ -87,12 +79,10 @@ public class TestCurrentStateComputationStage extends BaseStageTest
 
     runStage(event, new ReadClusterDataStage());
     runStage(event, stage);
-    CurrentStateOutput output2 =
-        event.getAttribute(AttributeName.CURRENT_STATE.toString());
+    CurrentStateOutput output2 = event.getAttribute(AttributeName.CURRENT_STATE.toString());
     String pendingState =
-        output2.getPendingState("testResourceName",
-                                new Partition("testResourceName_1"),
-                                "localhost_3");
+        output2.getPendingState("testResourceName", new Partition("testResourceName_1"),
+            "localhost_3");
     AssertJUnit.assertEquals(pendingState, "SLAVE");
 
     ZNRecord record1 = new ZNRecord("testResourceName");
@@ -107,22 +97,17 @@ public class TestCurrentStateComputationStage extends BaseStageTest
     stateWithDeadSession.setStateModelDefRef("MasterSlave");
     stateWithDeadSession.setState("testResourceName_1", "MASTER");
 
-    accessor.setProperty(keyBuilder.currentState("localhost_3",
-                                                 "session_3",
-                                                 "testResourceName"),
-                         stateWithLiveSession);
-    accessor.setProperty(keyBuilder.currentState("localhost_3",
-                                                 "session_dead",
-                                                 "testResourceName"),
-                         stateWithDeadSession);
+    accessor.setProperty(keyBuilder.currentState("localhost_3", "session_3", "testResourceName"),
+        stateWithLiveSession);
+    accessor.setProperty(
+        keyBuilder.currentState("localhost_3", "session_dead", "testResourceName"),
+        stateWithDeadSession);
     runStage(event, new ReadClusterDataStage());
     runStage(event, stage);
-    CurrentStateOutput output3 =
-        event.getAttribute(AttributeName.CURRENT_STATE.toString());
+    CurrentStateOutput output3 = event.getAttribute(AttributeName.CURRENT_STATE.toString());
     String currentState =
-        output3.getCurrentState("testResourceName",
-                                new Partition("testResourceName_1"),
-                                "localhost_3");
+        output3.getCurrentState("testResourceName", new Partition("testResourceName_1"),
+            "localhost_3");
     AssertJUnit.assertEquals(currentState, "OFFLINE");
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestMessageThrottleStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMessageThrottleStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMessageThrottleStage.java
index 6064e3a..cdf11fe 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMessageThrottleStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMessageThrottleStage.java
@@ -52,19 +52,14 @@ import org.apache.log4j.Logger;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestMessageThrottleStage extends ZkUnitTestBase
-{
-  private static final Logger LOG        =
-                                             Logger.getLogger(TestMessageThrottleStage.class.getName());
-  final String                _className = getShortClassName();
+public class TestMessageThrottleStage extends ZkUnitTestBase {
+  private static final Logger LOG = Logger.getLogger(TestMessageThrottleStage.class.getName());
+  final String _className = getShortClassName();
 
   @Test
-  public void testMsgThrottleBasic() throws Exception
-  {
+  public void testMsgThrottleBasic() throws Exception {
     String clusterName = "CLUSTER_" + _className + "_basic";
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     HelixDataAccessor accessor =
         new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(_gZkClient));
@@ -72,21 +67,24 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
 
     // ideal state: node0 is MASTER, node1 is SLAVE
     // replica=2 means 1 master and 1 slave
-    setupIdealState(clusterName, new int[] { 0, 1 }, new String[] { "TestDB" }, 1, 2);
-    setupLiveInstances(clusterName, new int[] { 0, 1 });
+    setupIdealState(clusterName, new int[] {
+        0, 1
+    }, new String[] {
+      "TestDB"
+    }, 1, 2);
+    setupLiveInstances(clusterName, new int[] {
+        0, 1
+    });
     setupStateModel(clusterName);
 
     ClusterEvent event = new ClusterEvent("testEvent");
     event.addAttribute("helixmanager", manager);
 
     MessageThrottleStage throttleStage = new MessageThrottleStage();
-    try
-    {
+    try {
       runStage(event, throttleStage);
       Assert.fail("Should throw exception since DATA_CACHE is null");
-    }
-    catch (Exception e)
-    {
+    } catch (Exception e) {
       // OK
     }
 
@@ -94,35 +92,25 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
     dataRefresh.addStage(new ReadClusterDataStage());
     runPipeline(event, dataRefresh);
 
-    try
-    {
+    try {
       runStage(event, throttleStage);
       Assert.fail("Should throw exception since RESOURCE is null");
-    }
-    catch (Exception e)
-    {
+    } catch (Exception e) {
       // OK
     }
     runStage(event, new ResourceComputationStage());
 
-    try
-    {
+    try {
       runStage(event, throttleStage);
       Assert.fail("Should throw exception since MESSAGE_SELECT is null");
-    }
-    catch (Exception e)
-    {
+    } catch (Exception e) {
       // OK
     }
     MessageSelectionStageOutput msgSelectOutput = new MessageSelectionStageOutput();
     List<Message> selectMessages = new ArrayList<Message>();
     Message msg =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-001",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_0");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-001", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_0");
     selectMessages.add(msg);
 
     msgSelectOutput.addMessages("TestDB", new Partition("TestDB_0"), selectMessages);
@@ -132,21 +120,17 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
 
     MessageThrottleStageOutput msgThrottleOutput =
         event.getAttribute(AttributeName.MESSAGES_THROTTLE.toString());
-    Assert.assertEquals(msgThrottleOutput.getMessages("TestDB", new Partition("TestDB_0"))
-                                         .size(),
-                        1);
+    Assert.assertEquals(msgThrottleOutput.getMessages("TestDB", new Partition("TestDB_0")).size(),
+        1);
 
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
   }
 
   @Test()
-  public void testMsgThrottleConstraints() throws Exception
-  {
+  public void testMsgThrottleConstraints() throws Exception {
     String clusterName = "CLUSTER_" + _className + "_constraints";
-    System.out.println("START " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("START " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
     HelixDataAccessor accessor =
         new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(_gZkClient));
@@ -154,8 +138,14 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
 
     // ideal state: node0 is MASTER, node1 is SLAVE
     // replica=2 means 1 master and 1 slave
-    setupIdealState(clusterName, new int[] { 0, 1 }, new String[] { "TestDB" }, 1, 2);
-    setupLiveInstances(clusterName, new int[] { 0, 1 });
+    setupIdealState(clusterName, new int[] {
+        0, 1
+    }, new String[] {
+      "TestDB"
+    }, 1, 2);
+    setupLiveInstances(clusterName, new int[] {
+        0, 1
+    });
     setupStateModel(clusterName);
 
     // setup constraints
@@ -218,7 +208,7 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
 
     Builder keyBuilder = accessor.keyBuilder();
     accessor.setProperty(keyBuilder.constraint(ConstraintType.MESSAGE_CONSTRAINT.toString()),
-                         new ClusterConstraints(record));
+        new ClusterConstraints(record));
 
     // ClusterConstraints constraint =
     // accessor.getProperty(ClusterConstraints.class,
@@ -233,15 +223,10 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
     // test constraintSelection
     // message1: hit contraintSelection rule1 and rule2
     Message msg1 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-001",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_0");
-
-    Map<ConstraintAttribute, String> msgAttr =
-        ClusterConstraints.toConstraintAttributes(msg1);
+        createMessage(MessageType.STATE_TRANSITION, "msgId-001", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_0");
+
+    Map<ConstraintAttribute, String> msgAttr = ClusterConstraints.toConstraintAttributes(msg1);
     Set<ConstraintItem> matches = constraint.match(msgAttr);
     System.out.println(msg1 + " matches(" + matches.size() + "): " + matches);
     Assert.assertEquals(matches.size(), 5);
@@ -259,12 +244,8 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
 
     // message2: hit contraintSelection rule1, rule2, and rule3
     Message msg2 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-002",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_1");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-002", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_1");
 
     msgAttr = ClusterConstraints.toConstraintAttributes(msg2);
     matches = constraint.match(msgAttr);
@@ -293,36 +274,20 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
     MessageSelectionStageOutput msgSelectOutput = new MessageSelectionStageOutput();
 
     Message msg3 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-003",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_0");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-003", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_0");
 
     Message msg4 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-004",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_0");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-004", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_0");
 
     Message msg5 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-005",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_0");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-005", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_0");
 
     Message msg6 =
-        createMessage(MessageType.STATE_TRANSITION,
-                      "msgId-006",
-                      "OFFLINE",
-                      "SLAVE",
-                      "TestDB",
-                      "localhost_1");
+        createMessage(MessageType.STATE_TRANSITION, "msgId-006", "OFFLINE", "SLAVE", "TestDB",
+            "localhost_1");
 
     List<Message> selectMessages = new ArrayList<Message>();
     selectMessages.add(msg1);
@@ -347,18 +312,13 @@ public class TestMessageThrottleStage extends ZkUnitTestBase
     Assert.assertTrue(throttleMessages.contains(msg3));
     Assert.assertTrue(throttleMessages.contains(msg4));
 
-    System.out.println("END " + clusterName + " at "
-        + new Date(System.currentTimeMillis()));
+    System.out.println("END " + clusterName + " at " + new Date(System.currentTimeMillis()));
 
   }
 
-  private boolean containsConstraint(Set<ConstraintItem> constraints,
-                                     ConstraintItem constraint)
-  {
-    for (ConstraintItem item : constraints)
-    {
-      if (item.toString().equals(constraint.toString()))
-      {
+  private boolean containsConstraint(Set<ConstraintItem> constraints, ConstraintItem constraint) {
+    for (ConstraintItem item : constraints) {
+      if (item.toString().equals(constraint.toString())) {
         return true;
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
index ebe5f5c..820abbe 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestMsgSelectionStage.java
@@ -33,12 +33,9 @@ import org.apache.helix.model.Message;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestMsgSelectionStage
-{
+public class TestMsgSelectionStage {
   @Test
-  public void testMasterXfer()
-  {
+  public void testMasterXfer() {
     System.out.println("START testMasterXfer at " + new Date(System.currentTimeMillis()));
 
     Map<String, LiveInstance> liveInstances = new HashMap<String, LiveInstance>();
@@ -52,18 +49,10 @@ public class TestMsgSelectionStage
     Map<String, String> pendingStates = new HashMap<String, String>();
 
     List<Message> messages = new ArrayList<Message>();
-    messages.add(TestHelper.createMessage("msgId_0",
-                                          "SLAVE",
-                                          "MASTER",
-                                          "localhost_0",
-                                          "TestDB",
-                                          "TestDB_0"));
-    messages.add(TestHelper.createMessage("msgId_1",
-                                          "MASTER",
-                                          "SLAVE",
-                                          "localhost_1",
-                                          "TestDB",
-                                          "TestDB_0"));
+    messages.add(TestHelper.createMessage("msgId_0", "SLAVE", "MASTER", "localhost_0", "TestDB",
+        "TestDB_0"));
+    messages.add(TestHelper.createMessage("msgId_1", "MASTER", "SLAVE", "localhost_1", "TestDB",
+        "TestDB_0"));
 
     Map<String, Bounds> stateConstraints = new HashMap<String, Bounds>();
     stateConstraints.put("MASTER", new Bounds(0, 1));
@@ -73,15 +62,9 @@ public class TestMsgSelectionStage
     stateTransitionPriorities.put("MASTER-SLAVE", 0);
     stateTransitionPriorities.put("SLAVE-MASTER", 1);
 
-
     List<Message> selectedMsg =
-        new MessageSelectionStage().selectMessages(liveInstances,
-                                                   currentStates,
-                                                   pendingStates,
-                                                   messages,
-                                                   stateConstraints,
-                                                   stateTransitionPriorities,
-                                                   "OFFLINE");
+        new MessageSelectionStage().selectMessages(liveInstances, currentStates, pendingStates,
+            messages, stateConstraints, stateTransitionPriorities, "OFFLINE");
 
     Assert.assertEquals(selectedMsg.size(), 1);
     Assert.assertEquals(selectedMsg.get(0).getMsgId(), "msgId_1");
@@ -89,8 +72,7 @@ public class TestMsgSelectionStage
   }
 
   @Test
-  public void testMasterXferAfterMasterResume()
-  {
+  public void testMasterXferAfterMasterResume() {
     System.out.println("START testMasterXferAfterMasterResume at "
         + new Date(System.currentTimeMillis()));
 
@@ -106,12 +88,8 @@ public class TestMsgSelectionStage
     pendingStates.put("localhost_1", "MASTER");
 
     List<Message> messages = new ArrayList<Message>();
-    messages.add(TestHelper.createMessage("msgId_0",
-                                          "SLAVE",
-                                          "MASTER",
-                                          "localhost_0",
-                                          "TestDB",
-                                          "TestDB_0"));
+    messages.add(TestHelper.createMessage("msgId_0", "SLAVE", "MASTER", "localhost_0", "TestDB",
+        "TestDB_0"));
 
     Map<String, Bounds> stateConstraints = new HashMap<String, Bounds>();
     stateConstraints.put("MASTER", new Bounds(0, 1));
@@ -122,13 +100,8 @@ public class TestMsgSelectionStage
     stateTransitionPriorities.put("SLAVE-MASTER", 1);
 
     List<Message> selectedMsg =
-        new MessageSelectionStage().selectMessages(liveInstances,
-                                                   currentStates,
-                                                   pendingStates,
-                                                   messages,
-                                                   stateConstraints,
-                                                   stateTransitionPriorities,
-                                                   "OFFLINE");
+        new MessageSelectionStage().selectMessages(liveInstances, currentStates, pendingStates,
+            messages, stateConstraints, stateTransitionPriorities, "OFFLINE");
 
     Assert.assertEquals(selectedMsg.size(), 0);
     System.out.println("END testMasterXferAfterMasterResume at "

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/f414aad4/helix-core/src/test/java/org/apache/helix/controller/stages/TestParseInfoFromAlert.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/controller/stages/TestParseInfoFromAlert.java b/helix-core/src/test/java/org/apache/helix/controller/stages/TestParseInfoFromAlert.java
index 6114cc3..d191345 100644
--- a/helix-core/src/test/java/org/apache/helix/controller/stages/TestParseInfoFromAlert.java
+++ b/helix-core/src/test/java/org/apache/helix/controller/stages/TestParseInfoFromAlert.java
@@ -25,33 +25,30 @@ import org.apache.helix.integration.ZkStandAloneCMTestBase;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
-public class TestParseInfoFromAlert extends ZkStandAloneCMTestBase
-{
+public class TestParseInfoFromAlert extends ZkStandAloneCMTestBase {
   @Test
-  public void TestParse()
-  {
+  public void TestParse() {
     StatsAggregationStage stage = new StatsAggregationStage();
     String controllerName = CONTROLLER_PREFIX + "_0";
     HelixManager manager = _startCMResultMap.get(controllerName)._manager;
-    
-    String instanceName  = stage.parseInstanceName("localhost_12918.TestStat@DB=123.latency", manager);
+
+    String instanceName =
+        stage.parseInstanceName("localhost_12918.TestStat@DB=123.latency", manager);
     Assert.assertTrue(instanceName.equals("localhost_12918"));
-    
-    instanceName  = stage.parseInstanceName("localhost_12955.TestStat@DB=123.latency", manager);
+
+    instanceName = stage.parseInstanceName("localhost_12955.TestStat@DB=123.latency", manager);
     Assert.assertTrue(instanceName == null);
-    
-    
-    instanceName  = stage.parseInstanceName("localhost_12922.TestStat@DB=123.latency", manager);
+
+    instanceName = stage.parseInstanceName("localhost_12922.TestStat@DB=123.latency", manager);
     Assert.assertTrue(instanceName.equals("localhost_12922"));
-    
-    
 
-    String resourceName  = stage.parseResourceName("localhost_12918.TestStat@DB=TestDB.latency", manager);
+    String resourceName =
+        stage.parseResourceName("localhost_12918.TestStat@DB=TestDB.latency", manager);
     Assert.assertTrue(resourceName.equals("TestDB"));
-    
 
-    String partitionName  = stage.parsePartitionName("localhost_12918.TestStat@DB=TestDB;Partition=TestDB_22.latency", manager);
+    String partitionName =
+        stage.parsePartitionName("localhost_12918.TestStat@DB=TestDB;Partition=TestDB_22.latency",
+            manager);
     Assert.assertTrue(partitionName.equals("TestDB_22"));
   }
 }


Mime
View raw message