You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by re...@apache.org on 2015/08/04 13:07:17 UTC

[1/4] stratos git commit: adding logs for the test cases

Repository: stratos
Updated Branches:
  refs/heads/master 874a22089 -> 4f91f25ca


adding logs for the test cases


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

Branch: refs/heads/master
Commit: 4f91f25ca416ac26e6190a5592b6a409c720fd1c
Parents: ef89aa9
Author: reka <rt...@gmail.com>
Authored: Tue Aug 4 15:01:20 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Tue Aug 4 15:02:12 2015 +0530

----------------------------------------------------------------------
 .../tests/SampleApplicationsTest.java           | 47 +++++++++++++++-----
 1 file changed, 35 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/4f91f25c/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
index 5f4eea6..d1c9163 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
@@ -111,6 +111,7 @@ public class SampleApplicationsTest extends StratosTestServerManager {
 
     @Test
     public void testAutoscalingPolicy() {
+        log.info("Started autoscaling policy test case**************************************");
         String policyId = "autoscaling-policy-c0";
         try {
             boolean added = autoscalingPolicyTest.addAutoscalingPolicy(policyId + ".json",
@@ -148,9 +149,9 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(String.format("[autoscaling-policy-id] %s didn't get removed successfully",
                     policyId), beanRemoved, null);
-
+            log.info("Ended autoscaling policy test case**************************************");
         } catch (Exception e) {
-            log.error(e);
+            log.error("An error occurred while handling [autoscaling policy] " + policyId, e);
             assertTrue("An error occurred while handling [autoscaling policy] " + policyId, false);
         }
     }
@@ -158,6 +159,8 @@ public class SampleApplicationsTest extends StratosTestServerManager {
     @Test
     public void testCartridgeGroup() {
         try {
+            log.info("Started Cartridge group test case**************************************");
+
             boolean addedC1 = cartridgeTest.addCartridge("c1.json", endpoint, restClient);
             assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c1"), addedC1, true);
 
@@ -225,14 +228,18 @@ public class SampleApplicationsTest extends StratosTestServerManager {
             assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s",
                     "c3"), removedC3, true);
 
+            log.info("Ended Cartridge group test case**************************************");
+
         } catch (Exception e) {
-            log.error(e);
-            assertTrue("An error occurred while handling autoscaling policy", false);
+            log.error("An error occurred while handling Cartridge group test case", e);
+            assertTrue("An error occurred while handling Cartridge group test case", false);
         }
     }
 
     @Test
     public void testApplication() {
+        log.info("Started application test case**************************************");
+
         try {
             boolean addedScalingPolicy = autoscalingPolicyTest.addAutoscalingPolicy("autoscaling-policy-1.json",
                     endpoint, restClient);
@@ -393,15 +400,19 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(removedN2, true);
 
+            log.info("Ended application test case**************************************");
+
         } catch (Exception e) {
-            log.error(e);
-            assertTrue("An error occurred while handling application", false);
+            log.error("An error occurred while handling application test case", e);
+            assertTrue("An error occurred while handling application test case", false);
         }
     }
 
     @Test
     public void testDeployApplication() {
         try {
+            log.info("Started application deploy/undeploy test case**************************************");
+
             //Initializing event Receivers
             initializeApplicationEventReceiver();
             initializeTopologyEventReceiver();
@@ -556,15 +567,19 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(removedN2, true);
 
+            log.info("Ended application deploy/undeploy test case**************************************");
+
         } catch (Exception e) {
-            log.error(e);
-            assertTrue("An error occurred while handling autoscaling policy", false);
+            log.error("An error occurred while handling application deployment/undeployment", e);
+            assertTrue("An error occurred while handling application deployment/undeployment", false);
         }
     }
 
     @Test
     public void testNetworkPartition() {
         try {
+            log.info("Started network partition test case**************************************");
+
             boolean added = networkPartitionTest.addNetworkPartition("network-partition-1.json",
                     endpoint, restClient);
             assertEquals(added, true);
@@ -597,8 +612,9 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(beanRemoved, null);
 
+            log.info("Ended network partition test case**************************************");
         } catch (Exception e) {
-            log.error(e);
+            log.error("An error occurred while handling network partitions",e);
             assertTrue("An error occurred while handling network partitions", false);
         }
     }
@@ -606,6 +622,8 @@ public class SampleApplicationsTest extends StratosTestServerManager {
     @Test
     public void testDeploymentPolicy() {
         try {
+            log.info("Started deployment policy test case**************************************");
+
             boolean addedN1 = networkPartitionTest.addNetworkPartition("network-partition-1.json",
                     endpoint, restClient);
             assertEquals(addedN1, true);
@@ -699,14 +717,18 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(beanRemovedN2, null);
 
+            log.info("Ended deployment policy test case**************************************");
+
         } catch (Exception e) {
-            log.error(e);
-            assertTrue("An error occurred while handling autoscaling policy", false);
+            log.error("An error occurred while handling deployment policy", e);
+            assertTrue("An error occurred while handling deployment policy", false);
         }
     }
 
     @Test
     public void testCartridge() {
+        log.info("Started Cartridge test case**************************************");
+
         try {
             boolean added = cartridgeTest.addCartridge("c0.json", endpoint, restClient);
             assertEquals(added, true);
@@ -779,8 +801,9 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(beanRemoved, null);
 
+            log.info("Ended Cartridge test case**************************************");
         } catch (Exception e) {
-            log.error(e);
+            log.error("An error occurred while handling cartridges", e);
             assertTrue("An error occurred while handling cartridges", false);
         }
     }


[4/4] stratos git commit: adding member count validation for cluster when cartridge min/max is updated

Posted by re...@apache.org.
adding member count validation for cluster when cartridge min/max is updated


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

Branch: refs/heads/master
Commit: 23c543deda188cb3b721581f64f8dd63004847a0
Parents: 874a220
Author: reka <rt...@gmail.com>
Authored: Mon Aug 3 18:29:34 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Tue Aug 4 15:02:12 2015 +0530

----------------------------------------------------------------------
 .../tests/SampleApplicationsTest.java           | 86 ++++++++++++++++++--
 .../src/test/resources/JMSOutputAdaptor.xml     |  2 +-
 2 files changed, 78 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/23c543de/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
index c98e8f9..b3fd793 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
@@ -112,15 +112,16 @@ public class SampleApplicationsTest extends StratosTestServerManager {
     @Test
     public void testAutoscalingPolicy() {
         try {
-            boolean added = autoscalingPolicyTest.addAutoscalingPolicy("autoscaling-policy-c0.json",
+            String policyId = "autoscaling-policy-c0";
+            boolean added = autoscalingPolicyTest.addAutoscalingPolicy(policyId + ".json",
                     endpoint, restClient);
-            assertEquals(added, true);
-            AutoscalePolicyBean bean = autoscalingPolicyTest.getAutoscalingPolicy("autoscaling-policy-c0", endpoint,
+            assertEquals(String.format("Autoscaling policy did not added: [autoscaling-policy-id] %s", policyId), added, true);
+            AutoscalePolicyBean bean = autoscalingPolicyTest.getAutoscalingPolicy(policyId, endpoint,
                     restClient);
-            assertEquals(bean.getId(), "autoscaling-policy-c0");
-            assertEquals(bean.getLoadThresholds().getRequestsInFlight().getThreshold(), 35.0, 0.0);
-            assertEquals(bean.getLoadThresholds().getMemoryConsumption().getThreshold(), 45.0, 0.0);
-            assertEquals(bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", bean.getId()),bean.getId(), policyId);
+            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId), bean.getLoadThresholds().getRequestsInFlight().getThreshold(), 35.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),bean.getLoadThresholds().getMemoryConsumption().getThreshold(), 45.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0);
 
             boolean updated = autoscalingPolicyTest.updateAutoscalingPolicy("autoscaling-policy-c0.json",
                     endpoint, restClient);
@@ -450,6 +451,9 @@ public class SampleApplicationsTest extends StratosTestServerManager {
             assertEquals(updated, true);
 
             assertGroupInstanceCount(bean.getApplicationId(), "group3", 2);
+
+            assertClusterMinMemberCount(bean.getApplicationId(), 2);
+
             ApplicationBean updatedBean = applicationTest.getApplication("g-sc-G123-1", endpoint,
                     restClient);
             assertEquals(updatedBean.getApplicationId(), "g-sc-G123-1");
@@ -849,7 +853,7 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                 applicationName), application);
 
         Collection<Group> groups = application.getAllGroupsRecursively();
-        for(Group group : groups) {
+        for (Group group : groups) {
             assertEquals(group.getInstanceContextCount() >= group.getGroupMinInstances(), true);
         }
     }
@@ -865,7 +869,7 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                 applicationName), application);
 
         Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively();
-        for(ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
+        for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
             String serviceName = clusterDataHolder.getServiceType();
             String clusterId = clusterDataHolder.getClusterId();
             Service service = TopologyManager.getTopology().getService(serviceName);
@@ -898,6 +902,70 @@ public class SampleApplicationsTest extends StratosTestServerManager {
 
     }
 
+    private void assertClusterMinMemberCount(String applicationName, int minMembers) {
+        long startTime = System.currentTimeMillis();
+
+        Application application = ApplicationManager.getApplications().getApplication(applicationName);
+        assertNotNull(String.format("Application is not found: [application-id] %s",
+                applicationName), application);
+
+        Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively();
+        for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) {
+            String serviceName = clusterDataHolder.getServiceType();
+            String clusterId = clusterDataHolder.getClusterId();
+            Service service = TopologyManager.getTopology().getService(serviceName);
+            assertNotNull(String.format("Service is not found: [application-id] %s [service] %s",
+                    applicationName, serviceName), service);
+
+            Cluster cluster = service.getCluster(clusterId);
+            assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
+                    applicationName, serviceName, clusterId), cluster);
+            boolean clusterActive = false;
+
+            for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) {
+                int activeInstances = 0;
+                for (Member member : cluster.getMembers()) {
+                    if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
+                        if (member.getStatus().equals(MemberStatus.Active)) {
+                            activeInstances++;
+                        }
+                    }
+                }
+                clusterActive = activeInstances >= minMembers;
+
+                while (!clusterActive) {
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException ignore) {
+                    }
+                    service = TopologyManager.getTopology().getService(serviceName);
+                    assertNotNull(String.format("Service is not found: [application-id] %s [service] %s",
+                            applicationName, serviceName), service);
+
+                    cluster = service.getCluster(clusterId);
+                    activeInstances = 0;
+                    for (Member member : cluster.getMembers()) {
+                        if (member.getClusterInstanceId().equals(instance.getInstanceId())) {
+                            if (member.getStatus().equals(MemberStatus.Active)) {
+                                activeInstances++;
+                            }
+                        }
+                    }
+                    clusterActive = activeInstances >= minMembers;
+                    assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s",
+                            applicationName, serviceName, clusterId), cluster);
+
+                    if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT) {
+                        break;
+                    }
+                }
+            }
+            assertEquals(String.format("Cluster status did not change to active: [cluster-id] %s", clusterId),
+                    clusterActive, true);
+        }
+
+    }
+
 
     /**
      * Assert application activation

http://git-wip-us.apache.org/repos/asf/stratos/blob/23c543de/products/stratos/modules/integration/src/test/resources/JMSOutputAdaptor.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/JMSOutputAdaptor.xml b/products/stratos/modules/integration/src/test/resources/JMSOutputAdaptor.xml
index 59c3653..a6a2cff 100755
--- a/products/stratos/modules/integration/src/test/resources/JMSOutputAdaptor.xml
+++ b/products/stratos/modules/integration/src/test/resources/JMSOutputAdaptor.xml
@@ -23,7 +23,7 @@
 <outputEventAdaptor name="JMSOutputAdaptor" statistics="disable"
   trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
   <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property-->
-  <property name="java.naming.provider.url">tcp://localhost:61616</property>
+  <property name="java.naming.provider.url">tcp://localhost:61617</property>
   <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
   <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
   <property name="transport.jms.DestinationType">topic</property>


[2/4] stratos git commit: adding assert messages

Posted by re...@apache.org.
adding assert messages


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

Branch: refs/heads/master
Commit: 5b733ad1842a54171b6ed0a4bd13bf2cdbd2356c
Parents: 23c543d
Author: reka <rt...@gmail.com>
Authored: Tue Aug 4 11:40:42 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Tue Aug 4 15:02:12 2015 +0530

----------------------------------------------------------------------
 .../tests/SampleApplicationsTest.java           | 83 ++++++++++++--------
 1 file changed, 52 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5b733ad1/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
index b3fd793..a4ad8e9 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
@@ -111,38 +111,47 @@ public class SampleApplicationsTest extends StratosTestServerManager {
 
     @Test
     public void testAutoscalingPolicy() {
+        String policyId = "autoscaling-policy-c0";
         try {
-            String policyId = "autoscaling-policy-c0";
             boolean added = autoscalingPolicyTest.addAutoscalingPolicy(policyId + ".json",
                     endpoint, restClient);
             assertEquals(String.format("Autoscaling policy did not added: [autoscaling-policy-id] %s", policyId), added, true);
             AutoscalePolicyBean bean = autoscalingPolicyTest.getAutoscalingPolicy(policyId, endpoint,
                     restClient);
-            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", bean.getId()),bean.getId(), policyId);
-            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId), bean.getLoadThresholds().getRequestsInFlight().getThreshold(), 35.0, 0.0);
-            assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),bean.getLoadThresholds().getMemoryConsumption().getThreshold(), 45.0, 0.0);
-            assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s is not correct", bean.getId()),
+                    bean.getId(), policyId);
+            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId),
+                    bean.getLoadThresholds().getRequestsInFlight().getThreshold(), 35.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),
+                    bean.getLoadThresholds().getMemoryConsumption().getThreshold(), 45.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),
+                    bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0);
 
-            boolean updated = autoscalingPolicyTest.updateAutoscalingPolicy("autoscaling-policy-c0.json",
+            boolean updated = autoscalingPolicyTest.updateAutoscalingPolicy(policyId + ".json",
                     endpoint, restClient);
-            assertEquals(updated, true);
-            AutoscalePolicyBean updatedBean = autoscalingPolicyTest.getAutoscalingPolicy("autoscaling-policy-c0", endpoint,
+            assertEquals(String.format("[autoscaling-policy-id] %s update failed", policyId), updated, true);
+            AutoscalePolicyBean updatedBean = autoscalingPolicyTest.getAutoscalingPolicy(policyId, endpoint,
                     restClient);
-            assertEquals(updatedBean.getLoadThresholds().getRequestsInFlight().getThreshold(), 30.0, 0.0);
-            assertEquals(updatedBean.getLoadThresholds().getMemoryConsumption().getThreshold(), 40.0, 0.0);
-            assertEquals(updatedBean.getLoadThresholds().getLoadAverage().getThreshold(), 20.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId),
+                    updatedBean.getLoadThresholds().getRequestsInFlight().getThreshold(), 30.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),
+                    updatedBean.getLoadThresholds().getMemoryConsumption().getThreshold(), 40.0, 0.0);
+            assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),
+                    updatedBean.getLoadThresholds().getLoadAverage().getThreshold(), 20.0, 0.0);
 
-            boolean removed = autoscalingPolicyTest.removeAutoscalingPolicy("autoscaling-policy-c0", endpoint,
+            boolean removed = autoscalingPolicyTest.removeAutoscalingPolicy(policyId, endpoint,
                     restClient);
-            assertEquals(removed, true);
+            assertEquals(String.format("[autoscaling-policy-id] %s couldn't be removed", policyId),
+                    removed, true);
 
-            AutoscalePolicyBean beanRemoved = autoscalingPolicyTest.getAutoscalingPolicy("autoscaling-policy-c0", endpoint,
+            AutoscalePolicyBean beanRemoved = autoscalingPolicyTest.getAutoscalingPolicy(policyId, endpoint,
                     restClient);
-            assertEquals(beanRemoved, null);
+            assertEquals(String.format("[autoscaling-policy-id] %s didn't get removed successfully",
+                    policyId), beanRemoved, null);
 
         } catch (Exception e) {
             log.error(e);
-            assertTrue("An error occurred while handling autoscaling policy", false);
+            assertTrue("An error occurred while handling [autoscaling policy] " + policyId, false);
         }
     }
 
@@ -150,59 +159,71 @@ public class SampleApplicationsTest extends StratosTestServerManager {
     public void testCartridgeGroup() {
         try {
             boolean addedC1 = cartridgeTest.addCartridge("c1.json", endpoint, restClient);
-            assertEquals(addedC1, true);
+            assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c1"), addedC1, true);
 
             boolean addedC2 = cartridgeTest.addCartridge("c2.json", endpoint, restClient);
-            assertEquals(addedC2, true);
+            assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c2"), addedC2, true);
 
             boolean addedC3 = cartridgeTest.addCartridge("c3.json", endpoint, restClient);
-            assertEquals(addedC3, true);
+            assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c3"), addedC3, true);
 
             boolean added = cartridgeGroupTest.addCartridgeGroup("cartrdige-nested.json",
                     endpoint, restClient);
-            assertEquals(added, true);
+            assertEquals(String.format("Cartridge Group did not added: [cartridge-group-name] %s",
+                    "cartrdige-nested"), added, true);
             CartridgeGroupBean bean = cartridgeGroupTest.getCartridgeGroup("G1", endpoint,
                     restClient);
-            assertEquals(bean.getName(), "G1");
+            assertEquals(String.format("Cartridge Group name did not match: [cartridge-group-name] %s",
+                    "cartrdige-nested"), bean.getName(), "G1");
 
             boolean updated = cartridgeGroupTest.updateCartridgeGroup("cartrdige-nested.json",
                     endpoint, restClient);
-            assertEquals(updated, true);
+            assertEquals(String.format("Cartridge Group did not updated: [cartridge-group-name] %s",
+                    "cartrdige-nested"), updated, true);
             CartridgeGroupBean updatedBean = cartridgeGroupTest.getCartridgeGroup("G1", endpoint,
                     restClient);
-            assertEquals(updatedBean.getName(), "G1");
+            assertEquals(String.format("Updated Cartridge Group didn't match: [cartridge-group-name] %s",
+                    "cartrdige-nested"), updatedBean.getName(), "G1");
 
             boolean removedC1 = cartridgeTest.removeCartridge("c1", endpoint,
                     restClient);
-            assertEquals(removedC1, false);
+            assertEquals(String.format("Cartridge can be removed while it is used in cartridge group: [cartridge-name] %s",
+                    "c1"), removedC1, false);
 
             boolean removedC2 = cartridgeTest.removeCartridge("c2", endpoint,
                     restClient);
-            assertEquals(removedC2, false);
+            assertEquals(String.format("Cartridge can be removed while it is used in cartridge group: [cartridge-name] %s",
+                    "c2"), removedC2, false);
 
             boolean removedC3 = cartridgeTest.removeCartridge("c3", endpoint,
                     restClient);
-            assertEquals(removedC3, false);
+            assertEquals(String.format("Cartridge can be removed while it is used in cartridge group: [cartridge-name] %s",
+                    "c2"), removedC3, false);
 
             boolean removed = cartridgeGroupTest.removeCartridgeGroup("G1", endpoint,
                     restClient);
-            assertEquals(removed, true);
+            assertEquals(String.format("Cartridge Group did not removed: [cartridge-group-name] %s",
+                    "cartrdige-nested"), removed, true);
 
             CartridgeGroupBean beanRemoved = cartridgeGroupTest.getCartridgeGroup("G1", endpoint,
                     restClient);
-            assertEquals(beanRemoved, null);
+            assertEquals(String.format("Cartridge Group did not removed completely: [cartridge-group-name] %s",
+                    "cartrdige-nested"), beanRemoved, null);
 
             removedC1 = cartridgeTest.removeCartridge("c1", endpoint,
                     restClient);
-            assertEquals(removedC1, true);
+            assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s",
+                    "c1"), removedC1, true);
 
             removedC2 = cartridgeTest.removeCartridge("c2", endpoint,
                     restClient);
-            assertEquals(removedC2, true);
+            assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s",
+                    "c2"), removedC2, true);
 
             removedC3 = cartridgeTest.removeCartridge("c3", endpoint,
                     restClient);
-            assertEquals(removedC3, true);
+            assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s",
+                    "c3"), removedC3, true);
 
         } catch (Exception e) {
             log.error(e);


[3/4] stratos git commit: adding error messages to test cases

Posted by re...@apache.org.
adding error messages to test cases


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

Branch: refs/heads/master
Commit: ef89aa9fbfb24599deda517bad4d9f11694bd065
Parents: 5b733ad
Author: reka <rt...@gmail.com>
Authored: Tue Aug 4 14:43:05 2015 +0530
Committer: reka <rt...@gmail.com>
Committed: Tue Aug 4 15:02:12 2015 +0530

----------------------------------------------------------------------
 .../tests/ApplicationPolicyTest.java            | 28 +++++--
 .../integration/tests/ApplicationTest.java      | 49 +++++++----
 .../tests/AutoscalingPolicyTest.java            | 27 ++++--
 .../integration/tests/CartridgeGroupTest.java   | 28 +++++--
 .../integration/tests/CartridgeTest.java        | 28 +++++--
 .../integration/tests/DeploymentPolicyTest.java | 28 +++++--
 .../integration/tests/NetworkPartitionTest.java | 28 +++++--
 .../tests/SampleApplicationsTest.java           |  1 +
 .../update/g-sc-G123-1-v1.json                  | 86 ++++++++++++++++++++
 9 files changed, 241 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationPolicyTest.java
index b1b37b2..05110bb 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationPolicyTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationPolicyTest.java
@@ -58,9 +58,12 @@ public class ApplicationPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the application policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add application policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class ApplicationPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the application policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get application policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -109,9 +115,12 @@ public class ApplicationPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the application policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update application policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -135,9 +144,12 @@ public class ApplicationPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the application policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove application policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationTest.java
index 284401e..d4f77a6 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/ApplicationTest.java
@@ -59,9 +59,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while deploying the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not deploy application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -111,9 +117,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while undeploying the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not undeploy application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -137,9 +146,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while force undeploying the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not forcefully undeploy application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -164,9 +176,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -188,9 +203,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -212,9 +230,12 @@ public class ApplicationTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the application";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove application";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/AutoscalingPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/AutoscalingPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/AutoscalingPolicyTest.java
index f5f3786..c76c0ef 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/AutoscalingPolicyTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/AutoscalingPolicyTest.java
@@ -57,9 +57,11 @@ public class AutoscalingPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            log.error("An unknown error occurred while trying to add autoscaling policy....");
+            throw new RuntimeException("An unknown error occurred while trying to add autoscaling policy");
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add Autoscaling policy....";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -84,9 +86,12 @@ public class AutoscalingPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the autosclaing policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get autoscaling policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -108,9 +113,12 @@ public class AutoscalingPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the autosclaing policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not updating autoscaling policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -134,9 +142,12 @@ public class AutoscalingPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the autosclaing policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove autoscaling policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeGroupTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeGroupTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeGroupTest.java
index dcbe5c9..4da1185 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeGroupTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeGroupTest.java
@@ -58,9 +58,12 @@ public class CartridgeGroupTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the cartridge group";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add cartridge group";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class CartridgeGroupTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the cartridge group";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get cartridge group";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -109,9 +115,12 @@ public class CartridgeGroupTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the cartridge group";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update cartridge group";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -135,9 +144,12 @@ public class CartridgeGroupTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the cartridge group";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove cartridge group";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeTest.java
index 7cd5412..680d8a7 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/CartridgeTest.java
@@ -58,9 +58,12 @@ public class CartridgeTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the cartridge";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add cartridge";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class CartridgeTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the cartridge";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get cartridge";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -109,9 +115,12 @@ public class CartridgeTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the cartridge";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update cartridge";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -135,9 +144,12 @@ public class CartridgeTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the cartridge";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove cartridge";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/DeploymentPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/DeploymentPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/DeploymentPolicyTest.java
index e7e80eb..d7d4dd4 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/DeploymentPolicyTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/DeploymentPolicyTest.java
@@ -58,9 +58,12 @@ public class DeploymentPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the deployment policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add deployment policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class DeploymentPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the deployment policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get deployment policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -111,9 +117,12 @@ public class DeploymentPolicyTest extends StratosArtifactsUtils {
                         }
                     }
                 }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the deployment policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update deployment policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -137,9 +146,12 @@ public class DeploymentPolicyTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the deployment policy";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove deployment policy";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/NetworkPartitionTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/NetworkPartitionTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/NetworkPartitionTest.java
index f0b46cf..42dff0a 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/NetworkPartitionTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/NetworkPartitionTest.java
@@ -58,9 +58,12 @@ public class NetworkPartitionTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while adding the networkpartition";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not add networkpartition";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -85,9 +88,12 @@ public class NetworkPartitionTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while getting the networkpartition";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not get networkpartition";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -109,9 +115,12 @@ public class NetworkPartitionTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while updating the networkpartition";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not update networkpartition";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
@@ -135,9 +144,12 @@ public class NetworkPartitionTest extends StratosArtifactsUtils {
                     }
                 }
             }
-            throw new RuntimeException("An unknown error occurred");
+            String msg = "An unknown error occurred while removing the networkpartition";
+            log.error(msg);
+            throw new RuntimeException(msg);
         } catch (Exception e) {
-            String message = "Could not start mock instance";
+            String message = "Could not remove networkpartition";
+            log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
index a4ad8e9..5f4eea6 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
@@ -496,6 +496,7 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(removedDep, false);
 
+            //Un-deploying the application
             boolean unDeployed = applicationTest.undeployApplication("g-sc-G123-1", endpoint,
                     restClient);
             assertEquals(unDeployed, true);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ef89aa9f/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json
new file mode 100644
index 0000000..fb5e000
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/applications/simple/single-cartridge-app/update/g-sc-G123-1-v1.json
@@ -0,0 +1,86 @@
+{
+    "alias": "g-sc-G123-1",
+    "applicationId": "g-sc-G123-1",
+    "components": {
+        "cartridges": [],
+        "groups": [
+            {
+                "name": "G1",
+                "groupMaxInstances": 5,
+                "groupMinInstances": 4,
+                "alias": "group1",
+                "cartridges": [
+                    {
+                        "cartridgeMin": 2,
+                        "cartridgeMax": 3,
+                        "type": "c1",
+                        "subscribableInfo": {
+                            "alias": "c1-1x0",
+                            "deploymentPolicy": "deployment-policy-1",
+                            "artifactRepository": {
+                                "repoUsername": "user",
+                                "repoUrl": "http://stratos.apache.org:10080/git/default.git",
+                                "privateRepo": true,
+                                "repoPassword": "c-policy"
+                            },
+                            "autoscalingPolicy": "autoscaling-policy-1"
+                        }
+                    }
+                ],
+                "groups": [
+                    {
+                        "name": "G2",
+                        "groupMaxInstances": 1,
+                        "groupMinInstances": 1,
+                        "alias": "group2",
+                        "cartridges": [
+                            {
+                                "cartridgeMin": 2,
+                                "cartridgeMax": 4,
+                                "type": "c2",
+                                "subscribableInfo": {
+                                    "alias": "c2-1x0",
+                                    "deploymentPolicy": "deployment-policy-1",
+                                    "artifactRepository": {
+                                        "repoUsername": "user",
+                                        "repoUrl": "http://stratos.apache.org:10080/git/default.git",
+                                        "privateRepo": true,
+                                        "repoPassword": "c-policy"
+                                    },
+                                    "autoscalingPolicy": "autoscaling-policy-1"
+                                }
+                            }
+                        ],
+                        "groups": [
+                            {
+                                "name": "G3",
+                                "groupMaxInstances": 3,
+                                "groupMinInstances": 2,
+                                "deploymentPolicy": "static-1",
+                                "alias": "group3",
+                                "cartridges": [
+                                    {
+                                        "cartridgeMin": 2,
+                                        "cartridgeMax": 3,
+                                        "type": "c3",
+                                        "subscribableInfo": {
+                                            "alias": "c3-1x0",
+                                            "artifactRepository": {
+                                                "repoUsername": "user",
+                                                "repoUrl": "http://stratos.apache.org:10080/git/default.git",
+                                                "privateRepo": true,
+                                                "repoPassword": "c-policy"
+                                            },
+                                            "autoscalingPolicy": "autoscaling-policy-1"
+                                        }
+                                    }
+                                ],
+                                "groups": []
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    }
+}