helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject [8/9] helix git commit: Assign orders for tests in TestSchedulerMessage
Date Thu, 02 Feb 2017 17:53:28 GMT
Assign orders for tests in TestSchedulerMessage


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/e9b4f6a1
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/e9b4f6a1
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/e9b4f6a1

Branch: refs/heads/helix-0.6.x
Commit: e9b4f6a1c13c28ce725f265e13ccfc7b860e33a5
Parents: e0f9f96
Author: Junkai Xue <jxue@linkedin.com>
Authored: Sat Jan 28 16:46:01 2017 -0800
Committer: Junkai Xue <jxue@linkedin.com>
Committed: Wed Feb 1 20:19:43 2017 -0800

----------------------------------------------------------------------
 .../helix/integration/TestSchedulerMessage.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/e9b4f6a1/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
index ef2e18d..c31e60b 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestSchedulerMessage.java
@@ -185,7 +185,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
     }
   }
 
-  @Test()
+  @Test(dependsOnMethods = "testSchedulerZeroMsg")
   public void testSchedulerMsg() throws Exception {
     Logger.getRootLogger().setLevel(Level.INFO);
     _factory._results.clear();
@@ -325,13 +325,13 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
     }
   }
 
-  @Test()
+  @Test
   public void testSchedulerZeroMsg() throws Exception {
-    TestMessagingHandlerFactory factory = new TestMessagingHandlerFactory();
+    _factory._results.clear();
     HelixManager manager = null;
     for (int i = 0; i < NODE_NR; i++) {
       _participants[i].getMessagingService().registerMessageHandlerFactory(
-          factory.getMessageType(), factory);
+          _factory.getMessageType(), _factory);
 
       manager = _participants[i]; // _startCMResultMap.get(hostDest)._manager;
     }
@@ -344,7 +344,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
     schedulerMessage.setSrcName("CONTROLLER");
 
     // Template for the individual message sent to each participant
-    Message msg = new Message(factory.getMessageType(), "Template");
+    Message msg = new Message(_factory.getMessageType(), "Template");
     msg.setTgtSessionId("*");
     msg.setMsgState(MessageState.NEW);
 
@@ -376,7 +376,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
 
     Thread.sleep(3000);
 
-    Assert.assertEquals(0, factory._results.size());
+    Assert.assertEquals(0, _factory._results.size());
     PropertyKey controllerTaskStatus =
         keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(),
             schedulerMessage.getMsgId());
@@ -389,13 +389,13 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
     ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
     Assert.assertTrue(statusUpdate.getMapField("SentMessageCount").get("MessageCount").equals("0"));
     int count = 0;
-    for (Set<String> val : factory._results.values()) {
+    for (Set<String> val : _factory._results.values()) {
       count += val.size();
     }
     Assert.assertEquals(count, 0);
   }
 
-  @Test()
+  @Test(dependsOnMethods = "testSchedulerMsg")
   public void testSchedulerMsg3() throws Exception {
     _factory._results.clear();
     Thread.sleep(2000);
@@ -517,7 +517,7 @@ public class TestSchedulerMessage extends ZkStandAloneCMTestBase {
     }
   }
 
-  @Test()
+  @Test(dependsOnMethods = "testSchedulerMsg3")
   public void testSchedulerMsg4() throws Exception {
     _factory._results.clear();
     HelixManager manager = null;


Mime
View raw message