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 17:52:27 UTC

stratos git commit: Adding more logs for assertClusterActivation test

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


Adding more logs for assertClusterActivation test


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

Branch: refs/heads/stratos-4.1.x
Commit: 4b3491d39fbc5f72ef99d23bb36c6e0317c0acfd
Parents: 6bdde45
Author: Akila Perera <ra...@gmail.com>
Authored: Wed Aug 26 21:22:05 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Wed Aug 26 21:22:05 2015 +0530

----------------------------------------------------------------------
 .../integration/tests/TopologyHandler.java       | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4b3491d3/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 5c911e9..f579718 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
@@ -183,9 +183,8 @@ public class TopologyHandler {
             }
         }
         assertNotNull(String.format("Application is not found: [application-id] %s", applicationName), application);
-        assertEquals(String.format("Application status did not change to %s: [application-id] %s",
-                        status.toString(), applicationName),
-                status, application.getStatus());
+        assertEquals(String.format("Application status did not change to %s: [application-id] %s", status.toString(),
+                applicationName), status, application.getStatus());
     }
 
     /**
@@ -225,9 +224,15 @@ public class TopologyHandler {
             Cluster cluster = service.getCluster(clusterId);
             assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
                     applicationName, serviceName, clusterId), cluster);
+            for (Member member : cluster.getMembers()) {
+                log.info(String.format("Member [member-id] %s found in cluster instance [cluster-instance] %s of " +
+                        "cluster [cluster-id] %s", member
+                        .getMemberId(), member.getClusterInstanceId(), member.getClusterId()));
+            }
             boolean clusterActive = false;
-            int activeInstances = 0;
+            int activeInstances;
             for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
+                log.info("Checking for active members in cluster instance: " + instance.getInstanceId());
                 activeInstances = 0;
                 for (Member member : cluster.getMembers()) {
                     if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
@@ -236,10 +241,10 @@ public class TopologyHandler {
                         }
                     }
                 }
+                clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
+                assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
+                        clusterActive);
             }
-            clusterActive = (activeInstances >= clusterDataHolder.getMinInstances());
-            assertTrue(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
-                    clusterActive);
         }
     }