You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/08/26 16:21:56 UTC

stratos git commit: Fix cluster activation assertion in Stratos integration tests

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x d72139dcd -> 6bdde45e9


Fix cluster activation assertion in Stratos integration tests


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

Branch: refs/heads/stratos-4.1.x
Commit: 6bdde45e9d48f350a84168a00dec989572b307a1
Parents: d72139d
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 19:51:22 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 19:51:22 2015 +0530

----------------------------------------------------------------------
 .../stratos/integration/tests/TopologyHandler.java   | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/6bdde45e/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
index 85f7817..5c911e9 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java
@@ -226,9 +226,9 @@ public class TopologyHandler {
             assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                     applicationName, serviceName, clusterId), cluster);
             boolean clusterActive = false;
-
+            int activeInstances = 0;
             for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
-                int activeInstances = 0;
+                activeInstances = 0;
                 for (Member member : cluster.getMembers()) {
                     if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
                         if (member.getStatus().equals(MemberStatus.Active)) {
@@ -236,16 +236,11 @@ public class TopologyHandler {
                         }
                     }
                 }
-                clusterActive = activeInstances >= clusterDataHolder.getMinInstances();
-
-                if (!clusterActive) {
-                    break;
-                }
             }
-            assertEquals(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
-                    clusterActive, true);
+            clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
+            assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
+                    clusterActive);
         }
-
     }
 
     /**