You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/11/24 14:43:58 UTC
[1/5] stratos git commit: cleaning GroupTerminationBehaviorTestCase
Repository: stratos
Updated Branches:
refs/heads/stratos-4.1.x ff86b3617 -> b1c70bedc
cleaning GroupTerminationBehaviorTestCase
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/35cb1bf0
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/35cb1bf0
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/35cb1bf0
Branch: refs/heads/stratos-4.1.x
Commit: 35cb1bf08562f2a13b4dcde4da6cb7abb62d9614
Parents: edb172b
Author: rajkumar <rr...@gmail.com>
Authored: Tue Nov 24 15:02:03 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Tue Nov 24 15:02:03 2015 +0530
----------------------------------------------------------------------
.../GroupTerminationBehaviorTestCase.java | 80 ++++++++++----------
1 file changed, 40 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/35cb1bf0/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTestCase.java
index 29bf31b..7ef911f 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTestCase.java
@@ -45,11 +45,19 @@ import static org.testng.AssertJUnit.assertTrue;
public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
private static final Log log = LogFactory.getLog(GroupTerminationBehaviorTestCase.class);
private static final String RESOURCES_PATH = "/group-termination-behavior-test";
+ private static final String autoscalingPolicyId = "autoscaling-policy-group-termination-behavior-test";
+ private static final String cartridgeId1 = "c1-group-termination-behavior-test";
+ private static final String cartridgeId2 = "c2-group-termination-behavior-test";
+ private static final String cartridgeId3 = "c3-group-termination-behavior-test";
+ private static final String cartridgeId4 = "c4-group-termination-behavior-test";
+ private static final String cartridgeGroupId = "cartridge-groups-group-termination-behavior-test";
+ private static final String networkPartitionId1 = "network-partition-group-termination-behavior-test-1";
+ private static final String deploymentPolicyId = "deployment-policy-group-termination-behavior-test";
private static final int GROUP_INACTIVE_TIMEOUT = 180000;
@Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment", "failed"})
public void testTerminationBehavior() throws Exception {
- String autoscalingPolicyId = "autoscaling-policy-group-termination-behavior-test";
+
TopologyHandler topologyHandler = TopologyHandler.getInstance();
boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH
@@ -58,27 +66,27 @@ public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
assertTrue(addedScalingPolicy);
boolean addedC1 = restClient.addEntity(
- RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c1-group-termination-behavior-test.json",
+ RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId1 + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
assertTrue(addedC1);
boolean addedC2 = restClient.addEntity(
- RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c2-group-termination-behavior-test.json",
+ RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId2 + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
assertTrue(addedC2);
boolean addedC3 = restClient.addEntity(
- RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c3-group-termination-behavior-test.json",
+ RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId3 + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
assertTrue(addedC3);
boolean addedC4 = restClient.addEntity(
- RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c4-group-termination-behavior-test.json",
+ RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId4 + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
assertTrue(addedC4);
boolean addedG1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH +
- "/" + "cartridge-groups-group-termination-behavior-test.json",
+ "/" + cartridgeGroupId + ".json",
RestConstants.CARTRIDGE_GROUPS,
RestConstants.CARTRIDGE_GROUPS_NAME);
assertTrue(addedG1);
@@ -89,38 +97,35 @@ public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
assertEquals(beanG1.getName(), "g-sc-G4-group-termination-behavior-test");
boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
- "network-partition-group-termination-behavior-test-1.json",
+ networkPartitionId1 + ".json",
RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
assertTrue(addedN1);
boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
- "deployment-policy-group-termination-behavior-test.json",
+ deploymentPolicyId + ".json",
RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME);
assertTrue(addedDep);
+ final String applicationId = "group-termination-behavior-test";
boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" +
- "group-termination-behavior-test.json", RestConstants.APPLICATIONS,
+ applicationId + ".json", RestConstants.APPLICATIONS,
RestConstants.APPLICATIONS_NAME);
assertTrue(added);
ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
- "group-termination-behavior-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+ applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
assertEquals(bean.getApplicationId(), "group-termination-behavior-test");
+ final String applicationPolicyId = "application-policy-group-termination-behavior-test";
boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
- "application-policy-group-termination-behavior-test.json",
+ applicationPolicyId + ".json",
RestConstants.APPLICATION_POLICIES,
RestConstants.APPLICATION_POLICIES_NAME);
assertTrue(addAppPolicy);
- ApplicationPolicyBean policyBean = (ApplicationPolicyBean) restClient.getEntity(
- RestConstants.APPLICATION_POLICIES,
- "application-policy-group-termination-behavior-test", ApplicationPolicyBean.class,
- RestConstants.APPLICATION_POLICIES_NAME);
-
//deploy the application
- String resourcePath = RestConstants.APPLICATIONS + "/" + "group-termination-behavior-test" +
- RestConstants.APPLICATIONS_DEPLOY + "/" + "application-policy-group-termination-behavior-test";
+ String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId +
+ RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId;
boolean deployed = restClient.deployEntity(resourcePath,
RestConstants.APPLICATIONS_NAME);
assertTrue(deployed);
@@ -199,44 +204,43 @@ public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
assertFalse(removedAuto);
boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-group-termination-behavior-test-1",
+ networkPartitionId1,
RestConstants.NETWORK_PARTITIONS_NAME);
//Trying to remove the used network partition
assertFalse(removedNet);
boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
- "deployment-policy-group-termination-behavior-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
+ deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
assertFalse(removedDep);
//Un-deploying the application
- String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + "group-termination-behavior-test" +
+ String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId +
RestConstants.APPLICATIONS_UNDEPLOY;
boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy,
RestConstants.APPLICATIONS_NAME);
assertTrue(unDeployed);
- boolean undeploy = topologyHandler.assertApplicationUndeploy("group-termination-behavior-test");
+ boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId);
if (!undeploy) {
//Need to forcefully undeploy the application
- log.info("Force undeployment is going to start for the [application] " +
- "group-termination-behavior-test");
+ log.info(String.format("Force undeployment is going to start for the [application] %s", applicationId));
- restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + "group-termination-behavior-test" +
+ restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + applicationId +
RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS);
- boolean forceUndeployed = topologyHandler.assertApplicationUndeploy("group-termination-behavior-test");
+ boolean forceUndeployed = topologyHandler.assertApplicationUndeploy(applicationId);
assertTrue(String.format("Forceful undeployment failed for the application %s",
- "group-termination-behavior-test"), forceUndeployed);
+ applicationId), forceUndeployed);
}
- boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, "group-termination-behavior-test",
+ boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId,
RestConstants.APPLICATIONS_NAME);
assertTrue(removed);
ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
- "group-termination-behavior-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+ applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
assertNull(beanRemoved);
removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS,
@@ -244,19 +248,19 @@ public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
RestConstants.CARTRIDGE_GROUPS_NAME);
assertTrue(removedGroup);
- boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c1-group-termination-behavior-test",
+ boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId1,
RestConstants.CARTRIDGES_NAME);
assertTrue(removedC1);
- boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "c2-group-termination-behavior-test",
+ boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId2,
RestConstants.CARTRIDGES_NAME);
assertTrue(removedC2);
- boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "c3-group-termination-behavior-test",
+ boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId3,
RestConstants.CARTRIDGES_NAME);
assertTrue(removedC3);
- boolean removedC4 = restClient.removeEntity(RestConstants.CARTRIDGES, "c4-group-termination-behavior-test",
+ boolean removedC4 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId4,
RestConstants.CARTRIDGES_NAME);
assertTrue(removedC4);
@@ -265,20 +269,16 @@ public class GroupTerminationBehaviorTestCase extends StratosIntegrationTest {
assertTrue(removedAuto);
removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
- "deployment-policy-group-termination-behavior-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
+ deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
assertTrue(removedDep);
removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-group-termination-behavior-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
+ networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME);
assertFalse(removedNet);
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
- "application-policy-group-termination-behavior-test", RestConstants.APPLICATION_POLICIES_NAME);
+ applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
assertTrue(removeAppPolicy);
-
- removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-group-termination-behavior-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
- assertTrue(removedNet);
}
private void assertGroupInactive(String groupId, String clusterId) {
[2/5] stratos git commit: Merge branch 'stratos-4.1.x' of
https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Posted by ra...@apache.org.
Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/1f02ac77
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/1f02ac77
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/1f02ac77
Branch: refs/heads/stratos-4.1.x
Commit: 1f02ac777aaca9472428b119d0fbea5c2843d50b
Parents: 35cb1bf e4a2af6
Author: rajkumar <rr...@gmail.com>
Authored: Tue Nov 24 16:08:43 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Tue Nov 24 16:08:43 2015 +0530
----------------------------------------------------------------------
.../stratos/metadata/service/Constants.java | 3 +-
.../MetadataApplicationEventReceiver.java | 93 ++++++++++
.../service/MetadataTopologyEventReceiver.java | 12 +-
.../service/exception/MetadataException.java | 4 +
.../metadata/service/registry/DataStore.java | 4 +-
.../service/registry/MetadataApiRegistry.java | 180 ++++++++++++-------
.../integration/common/RestConstants.java | 2 +
.../integration/common/TopologyHandler.java | 2 +
.../integration/common/rest/RestClient.java | 21 ++-
9 files changed, 236 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
[5/5] stratos git commit: Merge branch 'stratos-4.1.x' of
https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Posted by ra...@apache.org.
Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b1c70bed
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b1c70bed
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b1c70bed
Branch: refs/heads/stratos-4.1.x
Commit: b1c70bedc82c8e718c1d7f6ca5024342affea1f1
Parents: 196ab9f ff86b36
Author: rajkumar <rr...@gmail.com>
Authored: Tue Nov 24 19:13:39 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Tue Nov 24 19:13:39 2015 +0530
----------------------------------------------------------------------
.../integration/common/ServerLogClient.java | 93 +++++++++++++++-----
.../tests/iaas/IaaSProviderTestCase.java | 14 +--
.../iaas/IaasProviderAttributeTestCase.java | 7 +-
3 files changed, 82 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
[3/5] stratos git commit: Merge branch 'stratos-4.1.x' of
https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Posted by ra...@apache.org.
Merge branch 'stratos-4.1.x' of https://git-wip-us.apache.org/repos/asf/stratos into stratos-4.1.x
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d7d6ffd5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d7d6ffd5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d7d6ffd5
Branch: refs/heads/stratos-4.1.x
Commit: d7d6ffd5fdfeb2ef5730cb11ffb05332c2f3c909
Parents: 1f02ac7 b0f8e80
Author: rajkumar <rr...@gmail.com>
Authored: Tue Nov 24 17:39:36 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Tue Nov 24 17:39:36 2015 +0530
----------------------------------------------------------------------
.../stratos/integration/tests/StratosIntegrationTest.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------
[4/5] stratos git commit: undploying test artifacts
Posted by ra...@apache.org.
undploying test artifacts
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/196ab9fd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/196ab9fd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/196ab9fd
Branch: refs/heads/stratos-4.1.x
Commit: 196ab9fd7bc94b28a78b3f17698c01450b61e2d6
Parents: d7d6ffd
Author: rajkumar <rr...@gmail.com>
Authored: Tue Nov 24 19:13:25 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Tue Nov 24 19:13:25 2015 +0530
----------------------------------------------------------------------
.../ApplicationBurstingTestCase.java | 9 ++
.../application/ApplicationUpdateTestCase.java | 8 ++
.../application/GroupStartupOrderTestCase.java | 4 +
.../PartitionRoundRobinClusterTestCase.java | 100 ++++++++++---------
.../SingleClusterScalingTestCase.java | 41 ++++----
5 files changed, 97 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/196ab9fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java
index a782ae5..ce1e0c4 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java
@@ -27,6 +27,7 @@ import org.apache.stratos.integration.common.RestConstants;
import org.apache.stratos.integration.common.TopologyHandler;
import org.apache.stratos.integration.tests.StratosIntegrationTest;
import org.apache.stratos.messaging.domain.application.ApplicationStatus;
+import org.testng.Assert;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
@@ -214,5 +215,13 @@ public class ApplicationBurstingTestCase extends StratosIntegrationTest {
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
assertTrue(removeAppPolicy);
+
+ removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartition1, RestConstants.NETWORK_PARTITIONS_NAME);
+ Assert.assertTrue(removedNet);
+
+ removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartition2, RestConstants.NETWORK_PARTITIONS_NAME);
+ Assert.assertTrue(removedN2);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/196ab9fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java
index 38c09b1..0d2c5f7 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java
@@ -248,5 +248,13 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest {
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
assertEquals(removeAppPolicy, true);
+
+ removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedNet, true);
+
+ removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartitionId2, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedN2, true);
}
}
http://git-wip-us.apache.org/repos/asf/stratos/blob/196ab9fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java
index 2dd6d3b..4c7384c 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java
@@ -310,6 +310,10 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest {
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
assertTrue(removeAppPolicy);
+
+ removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertTrue(removedNet);
}
private void assertCreationOfNodes(String firstNodeId, String secondNodeId) {
http://git-wip-us.apache.org/repos/asf/stratos/blob/196ab9fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTestCase.java
index b088d8f..b8d119c 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTestCase.java
@@ -33,11 +33,14 @@ import org.apache.stratos.messaging.domain.topology.Member;
import org.apache.stratos.messaging.domain.topology.Service;
import org.apache.stratos.messaging.message.receiver.application.ApplicationManager;
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.*;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
@@ -47,52 +50,59 @@ import static org.testng.AssertJUnit.assertTrue;
public class PartitionRoundRobinClusterTestCase extends StratosIntegrationTest {
private static final Log log = LogFactory.getLog(PartitionRoundRobinClusterTestCase.class);
private static final String RESOURCES_PATH = "/partition-round-robin-cluster-test";
+ private static final String autoscalingPolicyId = "autoscaling-policy-partition-round-robin-test";
+ private static final String cartridgeId = "c7-partition-round-robin-test";
+ private static final String networkPartitionId = "network-partition-partition-round-robin-test";
+ private static final String deploymentPolicyId = "deployment-policy-partition-round-robin-test";
+ private static final String applicationId = "partition-round-robin-test";
+ private static final String applicationPolicyId = "application-policy-partition-round-robin-test";
@Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
public void testDeployApplication() throws Exception {
+
+
TopologyHandler topologyHandler = TopologyHandler.getInstance();
- String autoscalingPolicyId = "autoscaling-policy-partition-round-robin-test";
boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH
+ "/" + autoscalingPolicyId + ".json",
RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(addedScalingPolicy, true);
+ Assert.assertTrue(addedScalingPolicy);
boolean addedC1 = restClient.addEntity(
- RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c7-partition-round-robin-test.json",
+ RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
- assertEquals(addedC1, true);
+ Assert.assertTrue(addedC1);
boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
- "network-partition-partition-round-robin-test.json",
+ networkPartitionId + ".json",
RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(addedN1, true);
+ Assert.assertTrue(addedN1);
boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
- "deployment-policy-partition-round-robin-test.json",
+ deploymentPolicyId + ".json",
RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(addedDep, true);
+ Assert.assertTrue(addedDep);
boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" +
- "partition-round-robin-test.json", RestConstants.APPLICATIONS,
+ applicationId + ".json", RestConstants.APPLICATIONS,
RestConstants.APPLICATIONS_NAME);
- assertEquals(added, true);
+ Assert.assertTrue(added);
ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
- "partition-round-robin-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
- assertEquals(bean.getApplicationId(), "partition-round-robin-test");
+ applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+ assertEquals(bean.getApplicationId(), applicationId);
boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
- "application-policy-partition-round-robin-test.json", RestConstants.APPLICATION_POLICIES,
+ applicationPolicyId + ".json", RestConstants.APPLICATION_POLICIES,
RestConstants.APPLICATION_POLICIES_NAME);
- assertEquals(addAppPolicy, true);
+ Assert.assertTrue(addAppPolicy);
//deploy the application
- String resourcePath = RestConstants.APPLICATIONS + "/" + "partition-round-robin-test" +
- RestConstants.APPLICATIONS_DEPLOY + "/" + "application-policy-partition-round-robin-test";
+ String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId +
+ RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId;
boolean deployed = restClient.deployEntity(resourcePath,
RestConstants.APPLICATIONS_NAME);
- assertEquals(deployed, true);
+ Assert.assertTrue(deployed);
//Application active handling
@@ -120,73 +130,71 @@ public class PartitionRoundRobinClusterTestCase extends StratosIntegrationTest {
boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(removedAuto, false);
+ assertFalse(removedAuto);
boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-partition-round-robin-test",
+ networkPartitionId,
RestConstants.NETWORK_PARTITIONS_NAME);
//Trying to remove the used network partition
- assertEquals(removedNet, false);
+ assertFalse(removedNet);
boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
- "deployment-policy-partition-round-robin-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(removedDep, false);
+ deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertFalse(removedDep);
//Un-deploying the application
- String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + "partition-round-robin-test" +
+ String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId +
RestConstants.APPLICATIONS_UNDEPLOY;
boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy,
RestConstants.APPLICATIONS_NAME);
- assertEquals(unDeployed, true);
+ Assert.assertTrue(unDeployed);
- boolean undeploy = topologyHandler.assertApplicationUndeploy("partition-round-robin-test");
+ boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId);
if (!undeploy) {
//Need to forcefully undeploy the application
- log.info("Force undeployment is going to start for the [application] " + "partition-round-robin-test");
+ log.info(String.format("Force undeployment is going to start for the [application] %s", applicationId));
- restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + "partition-round-robin-test" +
+ restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + applicationId +
RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS);
- boolean forceUndeployed = topologyHandler.assertApplicationUndeploy("partition-round-robin-test");
+ boolean forceUndeployed = topologyHandler.assertApplicationUndeploy(applicationId);
assertTrue(String.format("Forceful undeployment failed for the application %s",
- "partition-round-robin-test"), forceUndeployed);
+ applicationId), forceUndeployed);
}
- boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, "partition-round-robin-test",
+ boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId,
RestConstants.APPLICATIONS_NAME);
- assertEquals(removed, true);
+ Assert.assertTrue(removed);
ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
- "partition-round-robin-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
- assertEquals(beanRemoved, null);
+ applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+ assertNull(beanRemoved);
- boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c7-partition-round-robin-test",
+ boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId,
RestConstants.CARTRIDGES_NAME);
- assertEquals(removedC1, true);
-
+ Assert.assertTrue(removedC1);
removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(removedAuto, true);
+ Assert.assertTrue(removedAuto);
removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
- "deployment-policy-partition-round-robin-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(removedDep, true);
+ deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ Assert.assertTrue(removedDep);
removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-partition-round-robin-test", RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(removedNet, false);
-
+ networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertFalse(removedNet);
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
- "application-policy-partition-round-robin-test", RestConstants.APPLICATION_POLICIES_NAME);
- assertEquals(removeAppPolicy, true);
+ applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
+ Assert.assertTrue(removeAppPolicy);
removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
- "network-partition-partition-round-robin-test", RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(removedNet, true);
+ networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
+ Assert.assertTrue(removedNet);
}
/**
http://git-wip-us.apache.org/repos/asf/stratos/blob/196ab9fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTestCase.java
index ffdb81d..3ea53e7 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTestCase.java
@@ -35,11 +35,14 @@ import org.apache.stratos.messaging.domain.topology.MemberStatus;
import org.apache.stratos.messaging.domain.topology.Service;
import org.apache.stratos.messaging.message.receiver.application.ApplicationManager;
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
+import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.Set;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNull;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
@@ -66,27 +69,27 @@ public class SingleClusterScalingTestCase extends StratosIntegrationTest {
boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH
+ "/" + autoscalingPolicyId + ".json",
RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(addedScalingPolicy, true);
+ Assert.assertTrue(addedScalingPolicy);
boolean addedC1 = restClient.addEntity(
RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId + ".json",
RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
- assertEquals(addedC1, true);
+ Assert.assertTrue(addedC1);
boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
networkPartitionId + ".json",
RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(addedN1, true);
+ Assert.assertTrue(addedN1);
boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
deploymentPolicyId + ".json",
RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(addedDep, true);
+ Assert.assertTrue(addedDep);
boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" +
applicationId + ".json", RestConstants.APPLICATIONS,
RestConstants.APPLICATIONS_NAME);
- assertEquals(added, true);
+ Assert.assertTrue(added);
ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
@@ -95,14 +98,14 @@ public class SingleClusterScalingTestCase extends StratosIntegrationTest {
boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
applicationPolicyId + ".json", RestConstants.APPLICATION_POLICIES,
RestConstants.APPLICATION_POLICIES_NAME);
- assertEquals(addAppPolicy, true);
+ Assert.assertTrue(addAppPolicy);
//deploy the application
String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId +
RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId;
boolean deployed = restClient.deployEntity(resourcePath,
RestConstants.APPLICATIONS_NAME);
- assertEquals(deployed, true);
+ Assert.assertTrue(deployed);
//Application active handling
topologyHandler.assertApplicationStatus(bean.getApplicationId()
@@ -122,17 +125,17 @@ public class SingleClusterScalingTestCase extends StratosIntegrationTest {
boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(removedAuto, false);
+ assertFalse(removedAuto);
boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
networkPartitionId,
RestConstants.NETWORK_PARTITIONS_NAME);
//Trying to remove the used network partition
- assertEquals(removedNet, false);
+ assertFalse(removedNet);
boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(removedDep, false);
+ assertFalse(removedDep);
//Un-deploying the application
String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId +
@@ -140,7 +143,7 @@ public class SingleClusterScalingTestCase extends StratosIntegrationTest {
boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy,
RestConstants.APPLICATIONS_NAME);
- assertEquals(unDeployed, true);
+ Assert.assertTrue(unDeployed);
boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId);
if (!undeploy) {
@@ -157,35 +160,35 @@ public class SingleClusterScalingTestCase extends StratosIntegrationTest {
boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId,
RestConstants.APPLICATIONS_NAME);
- assertEquals(removed, true);
+ Assert.assertTrue(removed);
ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
- assertEquals(beanRemoved, null);
+ assertNull(beanRemoved);
boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId,
RestConstants.CARTRIDGES_NAME);
- assertEquals(removedC1, true);
+ Assert.assertTrue(removedC1);
removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
- assertEquals(removedAuto, true);
+ Assert.assertTrue(removedAuto);
removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
- assertEquals(removedDep, true);
+ Assert.assertTrue(removedDep);
removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(removedNet, false);
+ assertFalse(removedNet);
boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
- assertEquals(removeAppPolicy, true);
+ Assert.assertTrue(removeAppPolicy);
removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
- assertEquals(removedNet, true);
+ Assert.assertTrue(removedNet);
}
/**