Repository: stratos
Updated Branches:
  refs/heads/master 8d321a267 -> 0eacfad93


adding write logs and changes in the variables


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

Branch: refs/heads/master
Commit: ced8fad4d0c9ea107c11ae2996ee9d7cd9d68147
Parents: 838b0bb
Author: reka <[email protected]>
Authored: Tue Aug 11 17:39:30 2015 +0530
Committer: reka <[email protected]>
Committed: Wed Aug 12 08:34:01 2015 +0530

----------------------------------------------------------------------
 .../application/ApplicationBurstingTest.java    |  26 ++--
 .../application/ApplicationUpdateTest.java      |  24 ++--
 .../PartitionOneAfterAnotherClusterTest.java    |  18 +--
 .../PartitionRoundRobinClusterTest.java         |  18 +--
 .../application/SampleApplicationsTest.java     | 141 +++++++++++--------
 .../application/SingleClusterScalingTest.java   |  18 +--
 .../tests/group/CartridgeGroupTest.java         |  16 +--
 .../integration/tests/group/CartridgeTest.java  |   6 +-
 .../tests/policies/ApplicationPolicyTest.java   |  12 +-
 .../tests/policies/AutoscalingPolicyTest.java   |  10 +-
 .../tests/policies/DeploymentPolicyTest.java    |  89 +++++++-----
 .../tests/policies/NetworkPartitionTest.java    |  31 ++--
 .../src/test/resources/stratos-testing.xml      |   6 +-
 13 files changed, 227 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
index b47fb73..6c62056 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
@@ -37,34 +37,34 @@ import static junit.framework.Assert.assertTrue;
  */
 public class ApplicationBurstingTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(SampleApplicationsTest.class);
-    private static final String TEST_PATH = "/application-bursting-test";
+    private static final String RESOURCES_PATH = "/application-bursting-test";
 
 
     @Test
     public void testApplicationBusting() {
         try {
-            log.info("Started application Bursting test 
case**************************************");
+            log.info("-------------------------------Started application 
Bursting test case-------------------------------");
 
             String autoscalingPolicyId = 
"autoscaling-policy-application-bursting-test";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "esb-application-bursting-test.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "esb-application-bursting-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedC2 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "php-application-bursting-test.json",
+            boolean addedC2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "php-application-bursting-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC2, true);
 
-            boolean addedC3 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "tomcat-application-bursting-test.json",
+            boolean addedC3 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "tomcat-application-bursting-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC3, true);
 
-            boolean addedG1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
+            boolean addedG1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
                             "/" + 
"esb-php-group-application-bursting-test.json", RestConstants.CARTRIDGE_GROUPS,
                     RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(addedG1, true);
@@ -74,22 +74,22 @@ public class ApplicationBurstingTest extends 
StratosTestServerManager {
                             CartridgeGroupBean.class, 
RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(beanG1.getName(), 
"esb-php-group-application-bursting-test");
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-application-bursting-test-1.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedN2 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-application-bursting-test-2.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN2, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             "deployment-policy-application-bursting-test.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "app-bursting-single-cartriddge-group.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -98,7 +98,7 @@ public class ApplicationBurstingTest extends 
StratosTestServerManager {
                     "application-bursting-test", ApplicationBean.class, 
RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), "application-bursting-test");
 
-            boolean addAppPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             
"application-policy-application-bursting-test.json", 
RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addAppPolicy, true);
@@ -217,7 +217,7 @@ public class ApplicationBurstingTest extends 
StratosTestServerManager {
                     "network-partition-application-bursting-test-2", 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(removedN2, true);
 
-            log.info("Ended application bursting test 
case**************************************");
+            log.info("-------------------------------Ended application 
bursting test case-------------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling  application 
bursting", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
index fc33908..c9e64b2 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
@@ -38,7 +38,7 @@ import static junit.framework.Assert.assertTrue;
  */
 public class ApplicationUpdateTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(ApplicationUpdateTest.class);
-    private static final String TEST_PATH = "/application-update-test";
+    private static final String RESOURCES_PATH = "/application-update-test";
 
     @Test
     public void testDeployApplication() {
@@ -47,24 +47,24 @@ public class ApplicationUpdateTest extends 
StratosTestServerManager {
 
             String autoscalingPolicyId = 
"autoscaling-policy-application-update-test";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c1-application-update-test.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c1-application-update-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedC2 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c2-application-update-test.json",
+            boolean addedC2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c2-application-update-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC2, true);
 
-            boolean addedC3 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c3-application-update-test.json",
+            boolean addedC3 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c3-application-update-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC3, true);
 
-            boolean addedG1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
+            boolean addedG1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
                             "/" + 
"cartrdige-nested-application-update-test.json", RestConstants.CARTRIDGE_GROUPS,
                     RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(addedG1, true);
@@ -74,22 +74,22 @@ public class ApplicationUpdateTest extends 
StratosTestServerManager {
                             CartridgeGroupBean.class, 
RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(beanG1.getName(), "G1-application-update-test");
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-application-update-test-1.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedN2 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-application-update-test-2.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN2, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             "deployment-policy-application-update-test.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "g-sc-G123-1-application-update-test.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -98,7 +98,7 @@ public class ApplicationUpdateTest extends 
StratosTestServerManager {
                     "g-sc-G123-1-application-update-test", 
ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), 
"g-sc-G123-1-application-update-test");
 
-            boolean addAppPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             "application-policy-application-update-test.json", 
RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addAppPolicy, true);
@@ -126,7 +126,7 @@ public class ApplicationUpdateTest extends 
StratosTestServerManager {
             
TopologyHandler.getInstance().assertClusterActivation(bean.getApplicationId());
 
             //Updating application
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "g-sc-G123-1-application-update-test-v1.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(updated, true);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
index 1bb4ddf..d8f6965 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
@@ -45,36 +45,36 @@ import static junit.framework.Assert.*;
  */
 public class PartitionOneAfterAnotherClusterTest extends 
StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(SampleApplicationsTest.class);
-    private static final String TEST_PATH = 
"/partition-round-robin-cluster-test";
+    private static final String RESOURCES_PATH = 
"/partition-round-robin-cluster-test";
 
 
     @Test
     public void testDeployApplication() {
         try {
-            log.info("Started Partition One after another test 
case**************************************");
+            log.info("-------------------------------Started Partition One 
after another test case-------------------------------");
 
             String autoscalingPolicyId = "autoscaling-policy-3";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-11.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             "deployment-policy-5.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "single-cluster-scaling-test.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -83,7 +83,7 @@ public class PartitionOneAfterAnotherClusterTest extends 
StratosTestServerManage
                     "single-cluster-scaling-test", ApplicationBean.class, 
RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), 
"single-cluster-scaling-test");
 
-            boolean addAppPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             "application-policy-4.json", 
RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addAppPolicy, true);
@@ -183,7 +183,7 @@ public class PartitionOneAfterAnotherClusterTest extends 
StratosTestServerManage
                     "network-partition-11", 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(removedNet, true);
 
-            log.info("Ended Partition one after another test 
case**************************************");
+            log.info("-------------------------------Ended Partition one after 
another test case-------------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling  application 
bursting", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
index d27c0db..ab7d592 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
@@ -45,36 +45,36 @@ import static junit.framework.Assert.*;
  */
 public class PartitionRoundRobinClusterTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(SampleApplicationsTest.class);
-    private static final String TEST_PATH = 
"/partition-round-robin-cluster-test";
+    private static final String RESOURCES_PATH = 
"/partition-round-robin-cluster-test";
 
 
     @Test
     public void testDeployApplication() {
         try {
-            log.info("Started application Bursting test 
case**************************************");
+            log.info("-------------------------------Started application 
Bursting test case-------------------------------");
 
             String autoscalingPolicyId = 
"autoscaling-policy-partition-round-robin-test";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7-partition-round-robin-test.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7-partition-round-robin-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-partition-round-robin-test.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             
"deployment-policy-partition-round-robin-test.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "partition-round-robin-test.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -83,7 +83,7 @@ public class PartitionRoundRobinClusterTest extends 
StratosTestServerManager {
                     "partition-round-robin-test", ApplicationBean.class, 
RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), 
"partition-round-robin-test");
 
-            boolean addAppPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             
"application-policy-partition-round-robin-test.json", 
RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addAppPolicy, true);
@@ -189,7 +189,7 @@ public class PartitionRoundRobinClusterTest extends 
StratosTestServerManager {
                     "network-partition-partition-round-robin-test", 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(removedNet, true);
 
-            log.info("Ended application bursting test 
case**************************************");
+            log.info("-------------------------------Ended application 
bursting test case-------------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling  application 
bursting", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
index a6b6095..4ca3632 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
@@ -23,8 +23,11 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.common.beans.application.ApplicationBean;
 import org.apache.stratos.common.beans.cartridge.CartridgeGroupBean;
+import org.apache.stratos.common.beans.cartridge.CartridgeGroupReferenceBean;
+import org.apache.stratos.common.beans.cartridge.CartridgeReferenceBean;
 import org.apache.stratos.integration.tests.RestConstants;
 import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.apache.stratos.messaging.domain.application.Group;
 import org.testng.annotations.Test;
 
 import static junit.framework.Assert.assertEquals;
@@ -36,32 +39,32 @@ import static junit.framework.Assert.assertTrue;
  */
 public class SampleApplicationsTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(SampleApplicationsTest.class);
-    private static final String TEST_PATH = "/sample-applications-test";
+    private static final String RESOURCES_PATH = "/sample-applications-test";
 
     @Test
     public void testApplication() {
-        log.info("Started application test 
case**************************************");
+        log.info("-------------------------------Started application test 
case-------------------------------");
         try {
             String autoscalingPolicyId = 
"autoscaling-policy-sample-applications-test";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c1-sample-applications-test.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c1-sample-applications-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedC2 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c2-sample-applications-test.json",
+            boolean addedC2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c2-sample-applications-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC2, true);
 
-            boolean addedC3 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c3-sample-applications-test.json",
+            boolean addedC3 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c3-sample-applications-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC3, true);
 
-            boolean addedG1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
+            boolean addedG1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
                             "/" + 
"cartrdige-nested-sample-applications-test.json", 
RestConstants.CARTRIDGE_GROUPS,
                     RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(addedG1, true);
@@ -71,22 +74,22 @@ public class SampleApplicationsTest extends 
StratosTestServerManager {
                             CartridgeGroupBean.class, 
RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(beanG1.getName(), "G1-sample-applications-test");
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-sample-applications-test-1.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedN2 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-sample-applications-test-2.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN2, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             "deployment-policy-sample-applications-test.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "g-sc-G123-1-sample-applications-test.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -95,34 +98,42 @@ public class SampleApplicationsTest extends 
StratosTestServerManager {
                     "g-sc-G123-1-sample-applications-test", 
ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), 
"g-sc-G123-1-sample-applications-test");
 
-            assertEquals(bean.getComponents().getGroups().get(0).getName(), 
"G1-sample-applications-test");
-            assertEquals(bean.getComponents().getGroups().get(0).getAlias(), 
"group1-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroupMaxInstances(), 1);
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroupMinInstances(), 1);
-
-            
assertEquals(bean.getComponents().getGroups().get(0).getCartridges().get(0).getType(),
 "c1-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 1);
-            
assertEquals(bean.getComponents().getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 2);
-
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getAlias(),
 "group2-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getName(),
 "G2-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroupMaxInstances(),
 1);
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroupMinInstances(),
 1);
-
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getType(),
 "c2-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 1);
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 2);
-
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getAlias(),
 "group3-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getName(),
 "G3-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getGroupMaxInstances(),
 2);
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getGroupMinInstances(),
 1);
-
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getType(),
 "c3-sample-applications-test");
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 1);
-            
assertEquals(bean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 2);
-
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + 
"/g-sc-G123-1-sample-applications-test-v1.json",
+            CartridgeGroupReferenceBean group1 = 
bean.getComponents().getGroups().get(0);
+            CartridgeGroupReferenceBean group2 = group1.getGroups().get(0);
+            CartridgeGroupReferenceBean group3 = group2.getGroups().get(0);
+            CartridgeReferenceBean c1 = group1.getCartridges().get(0);
+            CartridgeReferenceBean c2 = group2.getCartridges().get(0);
+            CartridgeReferenceBean c3 = group3.getCartridges().get(0);
+
+            assertEquals(group1.getName(), "G1-sample-applications-test");
+            assertEquals(group1.getAlias(), "group1-sample-applications-test");
+            assertEquals(group1.getGroupMaxInstances(), 1);
+            assertEquals(group1.getGroupMinInstances(), 1);
+
+            assertEquals(c1.getType(), "c1-sample-applications-test");
+            assertEquals(c1.getCartridgeMin(), 1);
+            assertEquals(c1.getCartridgeMax(), 2);
+
+            assertEquals(group2.getAlias(), "group2-sample-applications-test");
+            assertEquals(group2.getName(), "G2-sample-applications-test");
+            assertEquals(group2.getGroupMaxInstances(), 1);
+            assertEquals(group2.getGroupMinInstances(), 1);
+
+            assertEquals(c2.getType(), "c2-sample-applications-test");
+            assertEquals(c2.getCartridgeMin(), 1);
+            assertEquals(c2.getCartridgeMax(), 2);
+
+            assertEquals(group3.getAlias(), "group3-sample-applications-test");
+            assertEquals(group3.getName(), "G3-sample-applications-test");
+            assertEquals(group3.getGroupMaxInstances(), 2);
+            assertEquals(group3.getGroupMinInstances(), 1);
+
+            assertEquals(c3.getType(), "c3-sample-applications-test");
+            assertEquals(c3.getCartridgeMin(), 1);
+            assertEquals(c3.getCartridgeMax(), 2);
+
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH +
+                            "/g-sc-G123-1-sample-applications-test-v1.json",
                     RestConstants.APPLICATIONS, 
RestConstants.APPLICATIONS_NAME);
             assertEquals(updated, true);
 
@@ -130,32 +141,40 @@ public class SampleApplicationsTest extends 
StratosTestServerManager {
                     "g-sc-G123-1-sample-applications-test", 
ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
 
             assertEquals(bean.getApplicationId(), 
"g-sc-G123-1-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getName(), 
"G1-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getAlias(), 
"group1-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroupMaxInstances(),
 1);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroupMinInstances(),
 1);
 
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getCartridges().get(0).getType(),
 "c1-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 2);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 3);
+            group1 = updatedBean.getComponents().getGroups().get(0);
+            group2 = group1.getGroups().get(0);
+            group3 = group2.getGroups().get(0);
+            c1 = group1.getCartridges().get(0);
+            c2 = group2.getCartridges().get(0);
+            c3 = group3.getCartridges().get(0);
+
+            assertEquals(group1.getName(), "G1-sample-applications-test");
+            assertEquals(group1.getAlias(), "group1-sample-applications-test");
+            assertEquals(group1.getGroupMaxInstances(), 1);
+            assertEquals(group1.getGroupMinInstances(), 1);
+
+            assertEquals(c1.getType(), "c1-sample-applications-test");
+            assertEquals(c1.getCartridgeMin(), 2);
+            assertEquals(c1.getCartridgeMax(), 3);
 
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getAlias(),
 "group2-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getName(),
 "G2-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroupMaxInstances(),
 1);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroupMinInstances(),
 1);
+            assertEquals(group2.getAlias(), "group2-sample-applications-test");
+            assertEquals(group2.getName(), "G2-sample-applications-test");
+            assertEquals(group2.getGroupMaxInstances(), 1);
+            assertEquals(group2.getGroupMinInstances(), 1);
 
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getType(),
 "c2-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 2);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 4);
+            assertEquals(c2.getType(), "c2-sample-applications-test");
+            assertEquals(c2.getCartridgeMin(), 2);
+            assertEquals(c2.getCartridgeMax(), 4);
 
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getAlias(),
 "group3-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getName(),
 "G3-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getGroupMaxInstances(),
 3);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getGroupMinInstances(),
 2);
+            assertEquals(group3.getAlias(), "group3-sample-applications-test");
+            assertEquals(group3.getName(), "G3-sample-applications-test");
+            assertEquals(group3.getGroupMaxInstances(), 3);
+            assertEquals(group3.getGroupMinInstances(), 2);
 
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getType(),
 "c3-sample-applications-test");
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMin(),
 2);
-            
assertEquals(updatedBean.getComponents().getGroups().get(0).getGroups().get(0).getGroups().get(0).getCartridges().get(0).getCartridgeMax(),
 3);
+            assertEquals(c3.getType(), "c3-sample-applications-test");
+            assertEquals(c3.getCartridgeMin(), 2);
+            assertEquals(c3.getCartridgeMax(), 3);
 
 
             boolean removedGroup = 
restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, 
"G1-sample-applications-test",
@@ -217,7 +236,7 @@ public class SampleApplicationsTest extends 
StratosTestServerManager {
             assertEquals(String.format("[Network partition] 
network-partition-sample-applications-test-2 " +
                     "could not be removed for [application] 
g-sc-G123-1-sample-applications-test"),removedN2, true);
 
-            log.info("Ended application test 
case**************************************");
+            log.info("-------------------------------Ended application test 
case-------------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling application test 
case", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
index c42be16..f5fba7c 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
@@ -46,37 +46,37 @@ import static junit.framework.Assert.*;
  */
 public class SingleClusterScalingTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(SampleApplicationsTest.class);
-    private static final String TEST_PATH = "/single-cluster-scaling-test";
+    private static final String RESOURCES_PATH = 
"/single-cluster-scaling-test";
     private static final int CLUSTER_SCALE_UP_TIMEOUT = 180000;
 
 
     @Test
     public void testDeployApplication() {
         try {
-            log.info("Started application Bursting test 
case**************************************");
+            log.info("-------------------------------Started application 
Bursting test case-------------------------------");
 
             String autoscalingPolicyId = 
"autoscaling-policy-single-cluster-scaling-test";
 
-            boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
+            boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH
                             + "/" + autoscalingPolicyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(addedScalingPolicy, true);
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7-single-cluster-scaling-test.json",
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" + "c7-single-cluster-scaling-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(addedC1, true);
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-single-cluster-scaling-test.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             
"deployment-policy-single-cluster-scaling-test.json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATIONS_PATH + "/" +
                             "single-cluster-scaling-test.json", 
RestConstants.APPLICATIONS,
                     RestConstants.APPLICATIONS_NAME);
             assertEquals(added, true);
@@ -85,7 +85,7 @@ public class SingleClusterScalingTest extends 
StratosTestServerManager {
                     "single-cluster-scaling-test", ApplicationBean.class, 
RestConstants.APPLICATIONS_NAME);
             assertEquals(bean.getApplicationId(), 
"single-cluster-scaling-test");
 
-            boolean addAppPolicy = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             
"application-policy-single-cluster-scaling-test.json", 
RestConstants.APPLICATION_POLICIES,
                     RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addAppPolicy, true);
@@ -182,7 +182,7 @@ public class SingleClusterScalingTest extends 
StratosTestServerManager {
                     "network-partition-single-cluster-scaling-test", 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(removedNet, true);
 
-            log.info("Ended application bursting test 
case**************************************");
+            log.info("-------------------------Ended application bursting test 
case-------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling  application 
bursting", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
index ef73974..ccaeaf6 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
@@ -34,32 +34,32 @@ import static junit.framework.Assert.assertTrue;
  */
 public class CartridgeGroupTest extends StratosTestServerManager {
     private static final Log log = LogFactory.getLog(CartridgeGroupTest.class);
-    private static final String TEST_PATH = "/cartridge-group-test";
+    private static final String RESOURCES_PATH = "/cartridge-group-test";
 
     @Test
     public void testCartridgeGroup() {
         try {
-            log.info("Started Cartridge group test 
case**************************************");
+            log.info("-------------------------Started Cartridge group test 
case-------------------------");
 
-            boolean addedC1 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH +
+            boolean addedC1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH +
                             "/" + "c4-cartridge-group-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(String.format("Cartridge did not added: 
[cartridge-name] %s",
                     "c4-cartridge-group-test"), addedC1, true);
 
-            boolean addedC2 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH +
+            boolean addedC2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH +
                             "/" + "c5-cartridge-group-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(String.format("Cartridge did not added: 
[cartridge-name] %s",
                     "c5-cartridge-group-test"), addedC2, true);
 
-            boolean addedC3 = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH +
+            boolean addedC3 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH +
                             "/" + "c6-cartridge-group-test.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(String.format("Cartridge did not added: 
[cartridge-name] %s",
                     "c6-cartridge-group-test"), addedC3, true);
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
                             "/" + "g4-g5-g6-cartridge-group-test.json", 
RestConstants.CARTRIDGE_GROUPS,
                     RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(String.format("Cartridge Group did not added: 
[cartridge-group-name] %s",
@@ -71,7 +71,7 @@ public class CartridgeGroupTest extends 
StratosTestServerManager {
             assertEquals(String.format("Cartridge Group name did not match: 
[cartridge-group-name] %s",
                     "g4-g5-g6-cartridge-group-test.json"), bean.getName(), 
"G4-cartridge-group-test");
 
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGE_GROUPS_PATH +
                             "/" + "g4-g5-g6-cartridge-group-test-v1.json",
                     RestConstants.CARTRIDGE_GROUPS, 
RestConstants.CARTRIDGE_GROUPS_NAME);
             assertEquals(String.format("Cartridge Group did not updated: 
[cartridge-group-name] %s",
@@ -127,7 +127,7 @@ public class CartridgeGroupTest extends 
StratosTestServerManager {
             assertEquals(String.format("Cartridge can not be removed : 
[cartridge-name] %s",
                     "c6-cartridge-group-test"), removedC3, true);
 
-            log.info("Ended Cartridge group test 
case**************************************");
+            log.info("-------------------------Ended Cartridge group test 
case-------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling Cartridge group test 
case", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
index 5be9287..ac39161 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
@@ -35,7 +35,7 @@ import static junit.framework.Assert.assertTrue;
  */
 public class CartridgeTest extends StratosTestServerManager {
     private static final Log log = LogFactory.getLog(CartridgeTest.class);
-    private static final String TEST_PATH = "/cartridge-test";
+    private static final String RESOURCES_PATH = "/cartridge-test";
 
 
     @Test
@@ -44,7 +44,7 @@ public class CartridgeTest extends StratosTestServerManager {
 
         try {
             String cartridgeType = "c0-cartridge-test";
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" +
                             cartridgeType + ".json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(added, true);
@@ -78,7 +78,7 @@ public class CartridgeTest extends StratosTestServerManager {
             }
 
 
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.CARTRIDGES_PATH + "/" +
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.CARTRIDGES_PATH + "/" +
                             cartridgeType + "-v1.json",
                     RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
             assertEquals(updated, true);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
index 5da3d4c..bced0ff 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
@@ -36,26 +36,26 @@ import static junit.framework.Assert.assertTrue;
  */
 public class ApplicationPolicyTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(ApplicationPolicyTest.class);
-    private static final String TEST_PATH = "/application-policy-test";
+    private static final String RESOURCES_PATH = "/application-policy-test";
 
 
     @Test
     public void testApplicationPolicy() {
         try {
             String applicationPolicyId = 
"application-policy-application-policy-test";
-            log.info("Started Application policy test 
case**************************************");
+            log.info("-------------------------Started Application policy test 
case-------------------------");
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-application-policy-test-1" + 
".json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedN2 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-application-policy-test-2" + 
".json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN2, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.APPLICATION_POLICIES_PATH + "/" +
                             applicationPolicyId + ".json",
                     RestConstants.APPLICATION_POLICIES, 
RestConstants.APPLICATION_POLICIES_NAME);
             assertEquals(addedDep, true);
@@ -123,7 +123,7 @@ public class ApplicationPolicyTest extends 
StratosTestServerManager {
                             NetworkPartitionBean.class, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(beanRemovedN2, null);
 
-            log.info("Ended deployment policy test 
case**************************************");
+            log.info("-------------------------Ended deployment policy test 
case-------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling deployment policy", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
index e7f49b0..9a164c5 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
@@ -33,15 +33,15 @@ import static junit.framework.Assert.assertTrue;
  */
 public class AutoscalingPolicyTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(AutoscalingPolicyTest.class);
-    private static final String TEST_PATH = "/autoscaling-policy-test";
+    private static final String RESOURCES_PATH = "/autoscaling-policy-test";
 
 
     @Test
     public void testAutoscalingPolicy() {
-        log.info("Started autoscaling policy test 
case**************************************");
+        log.info("-------------------------Started autoscaling policy test 
case-------------------------");
         String policyId = "autoscaling-policy-autoscaling-policy-test";
         try {
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + ".json",
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + ".json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
 
             assertEquals(String.format("Autoscaling policy did not added: 
[autoscaling-policy-id] %s", policyId), added, true);
@@ -58,7 +58,7 @@ public class AutoscalingPolicyTest extends 
StratosTestServerManager {
             assertEquals(String.format("[autoscaling-policy-id] %s Load is not 
correct", policyId),
                     bean.getLoadThresholds().getLoadAverage().getThreshold(), 
25.0, 0.0);
 
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + "-v1.json",
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + "-v1.json",
                     RestConstants.AUTOSCALING_POLICIES, 
RestConstants.AUTOSCALING_POLICIES_NAME);
 
             assertEquals(String.format("[autoscaling-policy-id] %s update 
failed", policyId), updated, true);
@@ -82,7 +82,7 @@ public class AutoscalingPolicyTest extends 
StratosTestServerManager {
                     AutoscalePolicyBean.class, 
RestConstants.AUTOSCALING_POLICIES_NAME);
             assertEquals(String.format("[autoscaling-policy-id] %s didn't get 
removed successfully",
                     policyId), beanRemoved, null);
-            log.info("Ended autoscaling policy test 
case**************************************");
+            log.info("-------------------------Ended autoscaling policy test 
case---------------------------");
         } catch (Exception e) {
             log.error("An error occurred while handling [autoscaling policy] " 
+ policyId, e);
             assertTrue("An error occurred while handling [autoscaling policy] 
" + policyId, false);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
index 6f93fdc..4401443 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
@@ -22,6 +22,8 @@ package org.apache.stratos.integration.tests.policies;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.common.beans.partition.NetworkPartitionBean;
+import org.apache.stratos.common.beans.partition.NetworkPartitionReferenceBean;
+import org.apache.stratos.common.beans.partition.PartitionReferenceBean;
 import org.apache.stratos.common.beans.policy.deployment.DeploymentPolicyBean;
 import org.apache.stratos.integration.tests.RestConstants;
 import org.apache.stratos.integration.tests.StratosTestServerManager;
@@ -35,26 +37,26 @@ import static junit.framework.Assert.assertTrue;
  */
 public class DeploymentPolicyTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(DeploymentPolicyTest.class);
-    private static final String TEST_PATH = "/deployment-policy-test";
+    private static final String RESOURCES_PATH = "/deployment-policy-test";
 
 
     @Test
     public void testDeploymentPolicy() {
         try {
             String deploymentPolicyId = 
"deployment-policy-deployment-policy-test";
-            log.info("Started deployment policy test 
case**************************************");
+            log.info("-------------------------Started deployment policy test 
case-------------------------");
 
-            boolean addedN1 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN1 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-deployment-policy-test-1" + 
".json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN1, true);
 
-            boolean addedN2 = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean addedN2 = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             "network-partition-deployment-policy-test-2" + 
".json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(addedN2, true);
 
-            boolean addedDep = restClient.addEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+            boolean addedDep = restClient.addEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
                             deploymentPolicyId + ".json",
                     RestConstants.DEPLOYMENT_POLICIES, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(addedDep, true);
@@ -62,32 +64,39 @@ public class DeploymentPolicyTest extends 
StratosTestServerManager {
             DeploymentPolicyBean bean = (DeploymentPolicyBean) restClient.
                     getEntity(RestConstants.DEPLOYMENT_POLICIES, 
deploymentPolicyId,
                             DeploymentPolicyBean.class, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
+
+            NetworkPartitionReferenceBean nw1 = 
bean.getNetworkPartitions().get(0);
+            NetworkPartitionReferenceBean nw2 = 
bean.getNetworkPartitions().get(1);
+            PartitionReferenceBean nw1P1 = nw1.getPartitions().get(0);
+            PartitionReferenceBean nw2P1 = nw2.getPartitions().get(0);
+            PartitionReferenceBean nw2P2 = nw2.getPartitions().get(1);
+
             assertEquals(bean.getId(), 
"deployment-policy-deployment-policy-test");
             assertEquals(bean.getNetworkPartitions().size(), 2);
-            assertEquals(bean.getNetworkPartitions().get(0).getId(), 
"network-partition-deployment-policy-test-1");
-            
assertEquals(bean.getNetworkPartitions().get(0).getPartitionAlgo(), 
"one-after-another");
-            
assertEquals(bean.getNetworkPartitions().get(0).getPartitions().size(), 1);
-            
assertEquals(bean.getNetworkPartitions().get(0).getPartitions().get(0).getId(), 
"partition-1");
-            
assertEquals(bean.getNetworkPartitions().get(0).getPartitions().get(0).getPartitionMax(),
 20);
-
-            assertEquals(bean.getNetworkPartitions().get(1).getId(), 
"network-partition-deployment-policy-test-2");
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitionAlgo(), 
"round-robin");
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitions().size(), 2);
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(0).getId(),
+            assertEquals(nw1.getId(), 
"network-partition-deployment-policy-test-1");
+            assertEquals(nw1.getPartitionAlgo(), "one-after-another");
+            assertEquals(nw1.getPartitions().size(), 1);
+            assertEquals(nw1P1.getId(), "partition-1");
+            assertEquals(nw1P1.getPartitionMax(), 20);
+
+            assertEquals(nw2.getId(), 
"network-partition-deployment-policy-test-2");
+            assertEquals(nw2.getPartitionAlgo(), "round-robin");
+            assertEquals(nw2.getPartitions().size(), 2);
+            assertEquals(nw2P1.getId(),
                     "network-partition-6-partition-1");
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(),
 10);
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getId(),
+            assertEquals(nw2P1.getPartitionMax(), 10);
+            assertEquals(nw2P2.getId(),
                     "network-partition-6-partition-2");
-            
assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(),
 9);
+            assertEquals(nw2P2.getPartitionMax(), 9);
 
             //update network partition
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             
"network-partition-deployment-policy-test-1-v1.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(updated, true);
 
             //update deployment policy with new partition and max values
-            boolean updatedDep = restClient.updateEntity(TEST_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH +
+            boolean updatedDep = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.DEPLOYMENT_POLICIES_PATH +
                             "/" + deploymentPolicyId + "-v1.json", 
RestConstants.DEPLOYMENT_POLICIES,
                     RestConstants.DEPLOYMENT_POLICIES_NAME);
             assertEquals(updatedDep, true);
@@ -95,25 +104,33 @@ public class DeploymentPolicyTest extends 
StratosTestServerManager {
             DeploymentPolicyBean updatedBean = (DeploymentPolicyBean) 
restClient.
                     getEntity(RestConstants.DEPLOYMENT_POLICIES, 
deploymentPolicyId,
                             DeploymentPolicyBean.class, 
RestConstants.DEPLOYMENT_POLICIES_NAME);
+
+            nw1 = updatedBean.getNetworkPartitions().get(0);
+            nw2 = updatedBean.getNetworkPartitions().get(1);
+            nw1P1 = nw1.getPartitions().get(0);
+            PartitionReferenceBean nw1P2 = nw1.getPartitions().get(1);
+            nw2P1 = nw2.getPartitions().get(0);
+            nw2P2 = nw2.getPartitions().get(1);
+
             assertEquals(updatedBean.getId(), 
"deployment-policy-deployment-policy-test");
             assertEquals(updatedBean.getNetworkPartitions().size(), 2);
-            assertEquals(updatedBean.getNetworkPartitions().get(0).getId(), 
"network-partition-deployment-policy-test-1");
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitionAlgo(), 
"one-after-another");
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitions().size(), 
2);
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitions().get(0).getId(),
 "partition-1");
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitions().get(0).getPartitionMax(),
 25);
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitions().get(1).getId(),
 "partition-2");
-            
assertEquals(updatedBean.getNetworkPartitions().get(0).getPartitions().get(1).getPartitionMax(),
 20);
-
-            assertEquals(updatedBean.getNetworkPartitions().get(1).getId(), 
"network-partition-deployment-policy-test-2");
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitionAlgo(), 
"round-robin");
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().size(), 
2);
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(0).getId(),
+            assertEquals(nw1.getId(), 
"network-partition-deployment-policy-test-1");
+            assertEquals(nw1.getPartitionAlgo(), "one-after-another");
+            assertEquals(nw1.getPartitions().size(), 2);
+            assertEquals(nw1P1.getId(), "partition-1");
+            assertEquals(nw1P1.getPartitionMax(), 25);
+            assertEquals(nw1P2.getId(), "partition-2");
+            assertEquals(nw1P2.getPartitionMax(), 20);
+
+            assertEquals(nw2.getId(), 
"network-partition-deployment-policy-test-2");
+            assertEquals(nw2.getPartitionAlgo(), "round-robin");
+            assertEquals(nw2.getPartitions().size(), 2);
+            assertEquals(nw2P1.getId(),
                     "network-partition-6-partition-1");
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(),
 15);
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getId(),
+            assertEquals(nw2P1.getPartitionMax(), 15);
+            assertEquals(nw2P2.getId(),
                     "network-partition-6-partition-2");
-            
assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(),
 5);
+            assertEquals(nw2P2.getPartitionMax(), 5);
 
             boolean removedNet = 
restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
                     "network-partition-deployment-policy-test-1", 
RestConstants.NETWORK_PARTITIONS_NAME);
@@ -147,7 +164,7 @@ public class DeploymentPolicyTest extends 
StratosTestServerManager {
                             NetworkPartitionBean.class, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(beanRemovedN2, null);
 
-            log.info("Ended deployment policy test 
case**************************************");
+            log.info("-------------------------Ended deployment policy test 
case-------------------------");
 
         } catch (Exception e) {
             log.error("An error occurred while handling deployment policy", e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
index dce4f0c..684dc03 100644
--- 
a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
+++ 
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
@@ -22,6 +22,8 @@ package org.apache.stratos.integration.tests.policies;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.common.beans.partition.NetworkPartitionBean;
+import org.apache.stratos.common.beans.partition.NetworkPartitionReferenceBean;
+import org.apache.stratos.common.beans.partition.PartitionBean;
 import org.apache.stratos.integration.tests.RestConstants;
 import org.apache.stratos.integration.tests.StratosTestServerManager;
 import org.testng.annotations.Test;
@@ -34,16 +36,16 @@ import static junit.framework.Assert.assertTrue;
  */
 public class NetworkPartitionTest extends StratosTestServerManager {
     private static final Log log = 
LogFactory.getLog(NetworkPartitionTest.class);
-    private static final String TEST_PATH = "/network-partition-test";
+    private static final String RESOURCES_PATH = "/network-partition-test";
 
 
     @Test
     public void testNetworkPartition() {
         try {
             String networkPartitionId = 
"network-partition-network-partition-test";
-            log.info("Started network partition test 
case**************************************");
+            log.info("-------------------------Started network partition test 
case-------------------------");
 
-            boolean added = restClient.addEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean added = restClient.addEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             networkPartitionId + ".json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
 
@@ -52,13 +54,14 @@ public class NetworkPartitionTest extends 
StratosTestServerManager {
                     getEntity(RestConstants.NETWORK_PARTITIONS, 
networkPartitionId,
                             NetworkPartitionBean.class, 
RestConstants.NETWORK_PARTITIONS_NAME);
 
+            PartitionBean p1 = bean.getPartitions().get(0);
             assertEquals(bean.getId(), 
"network-partition-network-partition-test");
             assertEquals(bean.getPartitions().size(), 1);
-            assertEquals(bean.getPartitions().get(0).getId(), "partition-1");
-            
assertEquals(bean.getPartitions().get(0).getProperty().get(0).getName(), 
"region");
-            
assertEquals(bean.getPartitions().get(0).getProperty().get(0).getValue(), 
"default");
+            assertEquals(p1.getId(), "partition-1");
+            assertEquals(p1.getProperty().get(0).getName(), "region");
+            assertEquals(p1.getProperty().get(0).getValue(), "default");
 
-            boolean updated = restClient.updateEntity(TEST_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+            boolean updated = restClient.updateEntity(RESOURCES_PATH + 
RestConstants.NETWORK_PARTITIONS_PATH + "/" +
                             networkPartitionId + "-v1.json",
                     RestConstants.NETWORK_PARTITIONS, 
RestConstants.NETWORK_PARTITIONS_NAME);
 
@@ -66,13 +69,15 @@ public class NetworkPartitionTest extends 
StratosTestServerManager {
             NetworkPartitionBean updatedBean = (NetworkPartitionBean) 
restClient.
                     getEntity(RestConstants.NETWORK_PARTITIONS, 
networkPartitionId,
                             NetworkPartitionBean.class, 
RestConstants.NETWORK_PARTITIONS_NAME);
+
+            PartitionBean p2 = updatedBean.getPartitions().get(1);
             assertEquals(updatedBean.getId(), 
"network-partition-network-partition-test");
             assertEquals(updatedBean.getPartitions().size(), 2);
-            assertEquals(updatedBean.getPartitions().get(1).getId(), 
"partition-2");
-            
assertEquals(updatedBean.getPartitions().get(1).getProperty().get(0).getName(), 
"region");
-            
assertEquals(updatedBean.getPartitions().get(1).getProperty().get(0).getValue(),
 "default1");
-            
assertEquals(updatedBean.getPartitions().get(1).getProperty().get(1).getName(), 
"zone");
-            
assertEquals(updatedBean.getPartitions().get(1).getProperty().get(1).getValue(),
 "z1");
+            assertEquals(p2.getId(), "partition-2");
+            assertEquals(p2.getProperty().get(0).getName(), "region");
+            assertEquals(p2.getProperty().get(0).getValue(), "default1");
+            assertEquals(p2.getProperty().get(1).getName(), "zone");
+            assertEquals(p2.getProperty().get(1).getValue(), "z1");
 
             boolean removed = 
restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
                     networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
@@ -83,7 +88,7 @@ public class NetworkPartitionTest extends 
StratosTestServerManager {
                             NetworkPartitionBean.class, 
RestConstants.NETWORK_PARTITIONS_NAME);
             assertEquals(beanRemoved, null);
 
-            log.info("Ended network partition test 
case**************************************");
+            log.info("-------------------------Ended network partition test 
case-------------------------");
         } catch (Exception e) {
             log.error("An error occurred while handling network partitions", 
e);
             assertTrue("An error occurred while handling network partitions", 
false);

http://git-wip-us.apache.org/repos/asf/stratos/blob/ced8fad4/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml 
b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index 428c8fa..b522c63 100644
--- 
a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ 
b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@ -21,7 +21,7 @@
 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"; >
 
 <suite name="StratosIntegrationSuite">
-    <!--<test name="CartridgeTest">
+    <test name="CartridgeTest">
         <classes>
             <class 
name="org.apache.stratos.integration.tests.group.CartridgeTest" />
         </classes>
@@ -65,7 +65,7 @@
         <classes>
             <class 
name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest"
 />
         </classes>
-    </test>-->
+    </test>
     <test name="ApplicationBurstingTest">
         <classes>
             <class 
name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" 
/>
@@ -76,6 +76,4 @@
             <class 
name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest"
 />
         </classes>
     </test>
-
-
 </suite>

Reply via email to