helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [2/2] git commit: [HELIX-7] fix test failures
Date Wed, 03 Apr 2013 02:04:34 GMT
[HELIX-7] fix test failures

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

Branch: refs/heads/master
Commit: 58944dc4bbb6a427da6b557851a456b07856c143
Parents: fe6c846
Author: slu2011 <lushi04@gmail.com>
Authored: Tue Apr 2 19:04:24 2013 -0700
Committer: slu2011 <lushi04@gmail.com>
Committed: Tue Apr 2 19:04:24 2013 -0700

----------------------------------------------------------------------
 .../integration/TestStateTransitionTimeout.java    |    2 +-
 .../helix/mock/participant/MockMSStateModel.java   |   20 +++++++++------
 .../helix/mock/participant/MockTransition.java     |    2 +-
 .../helix/mock/participant/SleepTransition.java    |    3 +-
 4 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/58944dc4/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
b/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
index 1b91025..0a786d7 100644
--- a/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
+++ b/helix-core/src/test/java/org/apache/helix/integration/TestStateTransitionTimeout.java
@@ -116,7 +116,7 @@ public class TestStateTransitionTimeout extends ZkStandAloneCMTestBase
     }
 
     @Transition(to="MASTER",from="SLAVE")
-    public void onBecomeMasterFromSlave(Message message, NotificationContext context)
+    public void onBecomeMasterFromSlave(Message message, NotificationContext context) throws
InterruptedException
     {
       LOG.info("Become MASTER from SLAVE");
       if (_transition != null && _sleep)

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/58944dc4/helix-core/src/test/java/org/apache/helix/mock/participant/MockMSStateModel.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/participant/MockMSStateModel.java
b/helix-core/src/test/java/org/apache/helix/mock/participant/MockMSStateModel.java
index acebf3e..a523abd 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/participant/MockMSStateModel.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/participant/MockMSStateModel.java
@@ -51,14 +51,18 @@ public class MockMSStateModel extends StateModel
     LOG.info("Become DROPPED from ERROR");
     if (_transition != null)
     {
-      _transition.doTransition(message, context);
-
+      try
+      {
+        _transition.doTransition(message, context);
+      }
+      catch(Exception e)
+      {}
     }
   }
 
   
   @Transition(to = "SLAVE", from = "OFFLINE")
-  public void onBecomeSlaveFromOffline(Message message, NotificationContext context)
+  public void onBecomeSlaveFromOffline(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become SLAVE from OFFLINE");
     if (_transition != null)
@@ -69,7 +73,7 @@ public class MockMSStateModel extends StateModel
   }
 
   @Transition(to = "MASTER", from = "SLAVE")
-  public void onBecomeMasterFromSlave(Message message, NotificationContext context)
+  public void onBecomeMasterFromSlave(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become MASTER from SLAVE");
     if (_transition != null)
@@ -79,7 +83,7 @@ public class MockMSStateModel extends StateModel
   }
 
   @Transition(to = "SLAVE", from = "MASTER")
-  public void onBecomeSlaveFromMaster(Message message, NotificationContext context)
+  public void onBecomeSlaveFromMaster(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become SLAVE from MASTER");
     if (_transition != null)
@@ -89,7 +93,7 @@ public class MockMSStateModel extends StateModel
   }
 
   @Transition(to = "OFFLINE", from = "SLAVE")
-  public void onBecomeOfflineFromSlave(Message message, NotificationContext context)
+  public void onBecomeOfflineFromSlave(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become OFFLINE from SLAVE");
     if (_transition != null)
@@ -99,7 +103,7 @@ public class MockMSStateModel extends StateModel
   }
 
   @Transition(to = "DROPPED", from = "OFFLINE")
-  public void onBecomeDroppedFromOffline(Message message, NotificationContext context)
+  public void onBecomeDroppedFromOffline(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become DROPPED from OFFLINE");
     if (_transition != null)
@@ -109,7 +113,7 @@ public class MockMSStateModel extends StateModel
   }
 
   @Transition(to = "OFFLINE", from = "ERROR")
-  public void onBecomeOfflineFromError(Message message, NotificationContext context)
+  public void onBecomeOfflineFromError(Message message, NotificationContext context) throws
InterruptedException
   {
     LOG.info("Become OFFLINE from ERROR");
     // System.err.println("Become OFFLINE from ERROR");

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/58944dc4/helix-core/src/test/java/org/apache/helix/mock/participant/MockTransition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/participant/MockTransition.java
b/helix-core/src/test/java/org/apache/helix/mock/participant/MockTransition.java
index bdbcd13..e646849 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/participant/MockTransition.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/participant/MockTransition.java
@@ -29,7 +29,7 @@ public class MockTransition
   private static Logger LOG = Logger.getLogger(MockTransition.class);
 
   // called by state model transition functions
-  public void doTransition(Message message, NotificationContext context)
+  public void doTransition(Message message, NotificationContext context) throws InterruptedException
   {
     LOG.info("default doTransition() invoked");
   }

http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/58944dc4/helix-core/src/test/java/org/apache/helix/mock/participant/SleepTransition.java
----------------------------------------------------------------------
diff --git a/helix-core/src/test/java/org/apache/helix/mock/participant/SleepTransition.java
b/helix-core/src/test/java/org/apache/helix/mock/participant/SleepTransition.java
index eacd131..68de72b 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/participant/SleepTransition.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/participant/SleepTransition.java
@@ -33,13 +33,14 @@ public class SleepTransition extends MockTransition
   }
 
   @Override
-  public void doTransition(Message message, NotificationContext context)
+  public void doTransition(Message message, NotificationContext context) throws InterruptedException
   {
     try {
       Thread.sleep(_delay);
     } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
+      throw e;
     }
 
   }


Mime
View raw message