You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/08/10 13:03:21 UTC
[5/6] stratos git commit: Add the updated integration tests
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/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
new file mode 100644
index 0000000..e861e12
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.stratos.integration.tests.group;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.beans.PropertyBean;
+import org.apache.stratos.common.beans.cartridge.CartridgeBean;
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Test to handle Cartridge CRUD operations
+ */
+public class CartridgeTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(CartridgeTest.class);
+ private static final String TEST_PATH = "/cartridge-test";
+
+
+ @Test
+ public void testCartridge() {
+ log.info("Started Cartridge test case**************************************");
+
+ try {
+ String cartridgeType = "c0";
+ boolean added = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" +
+ cartridgeType + ".json",
+ RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
+ assertEquals(added, true);
+ CartridgeBean bean = (CartridgeBean) restClient.
+ getEntity(RestConstants.CARTRIDGES, cartridgeType,
+ CartridgeBean.class, RestConstants.CARTRIDGES_NAME);
+ assertEquals(bean.getCategory(), "Application");
+ assertEquals(bean.getHost(), "qmog.cisco.com");
+ for (PropertyBean property : bean.getProperty()) {
+ if (property.getName().equals("payload_parameter.CEP_IP")) {
+ assertEquals(property.getValue(), "octl.qmog.cisco.com");
+ } else if (property.getName().equals("payload_parameter.CEP_ADMIN_PASSWORD")) {
+ assertEquals(property.getValue(), "admin");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_IP")) {
+ assertEquals(property.getValue(), "octl.qmog.cisco.com");
+ } else if (property.getName().equals("payload_parameter.QTCM_NETWORK_COUNT")) {
+ assertEquals(property.getValue(), "1");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD")) {
+ assertEquals(property.getValue(), "admin");
+ } else if (property.getName().equals("payload_parameter.QTCM_DNS_SEGMENT")) {
+ assertEquals(property.getValue(), "test");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_SECURE_PORT")) {
+ assertEquals(property.getValue(), "7711");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_PORT")) {
+ assertEquals(property.getValue(), "7611");
+ } else if (property.getName().equals("payload_parameter.CEP_PORT")) {
+ assertEquals(property.getValue(), "7611");
+ } else if (property.getName().equals("payload_parameter.MB_PORT")) {
+ assertEquals(property.getValue(), "61616");
+ }
+ }
+
+
+ boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" +
+ cartridgeType + "-v1.json",
+ RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
+ assertEquals(updated, true);
+ CartridgeBean updatedBean = (CartridgeBean) restClient.
+ getEntity(RestConstants.CARTRIDGES, cartridgeType,
+ CartridgeBean.class, RestConstants.CARTRIDGES_NAME);
+ assertEquals(updatedBean.getType(), "c0");
+ assertEquals(updatedBean.getCategory(), "Data");
+ assertEquals(updatedBean.getHost(), "qmog.cisco.com12");
+ for (PropertyBean property : updatedBean.getProperty()) {
+ if (property.getName().equals("payload_parameter.CEP_IP")) {
+ assertEquals(property.getValue(), "octl.qmog.cisco.com123");
+ } else if (property.getName().equals("payload_parameter.CEP_ADMIN_PASSWORD")) {
+ assertEquals(property.getValue(), "admin123");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_IP")) {
+ assertEquals(property.getValue(), "octl.qmog.cisco.com123");
+ } else if (property.getName().equals("payload_parameter.QTCM_NETWORK_COUNT")) {
+ assertEquals(property.getValue(), "3");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD")) {
+ assertEquals(property.getValue(), "admin123");
+ } else if (property.getName().equals("payload_parameter.QTCM_DNS_SEGMENT")) {
+ assertEquals(property.getValue(), "test123");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_SECURE_PORT")) {
+ assertEquals(property.getValue(), "7712");
+ } else if (property.getName().equals("payload_parameter.MONITORING_SERVER_PORT")) {
+ assertEquals(property.getValue(), "7612");
+ } else if (property.getName().equals("payload_parameter.CEP_PORT")) {
+ assertEquals(property.getValue(), "7612");
+ } else if (property.getName().equals("payload_parameter.MB_PORT")) {
+ assertEquals(property.getValue(), "61617");
+ }
+ }
+
+ boolean removed = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeType,
+ RestConstants.CARTRIDGES_NAME);
+ assertEquals(removed, true);
+
+ CartridgeBean beanRemoved = (CartridgeBean) restClient.
+ getEntity(RestConstants.CARTRIDGES, cartridgeType,
+ CartridgeBean.class, RestConstants.CARTRIDGES_NAME);
+ assertEquals(beanRemoved, null);
+
+ log.info("Ended Cartridge test case**************************************");
+ } catch (Exception e) {
+ log.error("An error occurred while handling RESTConstants.CARTRIDGES_PATH", e);
+ assertTrue("An error occurred while handling RESTConstants.CARTRIDGES_PATH", false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/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
new file mode 100644
index 0000000..08ac19f
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+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.PropertyBean;
+import org.apache.stratos.common.beans.partition.NetworkPartitionBean;
+import org.apache.stratos.common.beans.policy.deployment.ApplicationPolicyBean;
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Test to handle Network partition CRUD operations
+ */
+public class ApplicationPolicyTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(ApplicationPolicyTest.class);
+ private static final String TEST_PATH = "/application-policy-test";
+
+
+ @Test
+ public void testApplicationPolicy() {
+ try {
+ String applicationPolicyId = "application-policy-2";
+ log.info("Started Application policy test case**************************************");
+
+ boolean addedN1 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ "network-partition-7" + ".json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(addedN1, true);
+
+ boolean addedN2 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ "network-partition-8" + ".json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(addedN2, true);
+
+ boolean addedDep = restClient.addEntity(TEST_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
+ applicationPolicyId + ".json",
+ RestConstants.APPLICATION_POLICIES, RestConstants.APPLICATION_POLICIES_NAME);
+ assertEquals(addedDep, true);
+
+ ApplicationPolicyBean bean = (ApplicationPolicyBean) restClient.
+ getEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId,
+ ApplicationPolicyBean.class, RestConstants.APPLICATION_POLICIES_NAME);
+ assertEquals(bean.getId(), applicationPolicyId);
+ assertEquals(String.format("The expected algorithm %s is not found in %s",
+ "one-after-another", applicationPolicyId), bean.getAlgorithm(), "one-after-another");
+ assertEquals(String.format("The expected id %s is not found",
+ applicationPolicyId), bean.getId(), applicationPolicyId);
+ assertEquals(String.format("The expected networkpartitions size %s is not found in %s",
+ 2, applicationPolicyId), bean.getNetworkPartitions().length, 2);
+ assertEquals(String.format("The first network partition is not %s in %s",
+ "network-partition-7", applicationPolicyId), bean.getNetworkPartitions()[0],
+ "network-partition-7");
+ assertEquals(String.format("The Second network partition is not %s in %s",
+ "network-partition-8", applicationPolicyId), bean.getNetworkPartitions()[1],
+ "network-partition-8");
+ /* boolean algoFound = false;
+ for (PropertyBean propertyBean : bean.getProperties()) {
+ if (propertyBean.getName().equals("networkPartitionGroups")) {
+ assertEquals(String.format("The networkPartitionGroups algorithm %s is not found in %s",
+ "network-partition-7,network-partition-8", applicationPolicyId),
+ propertyBean.getValue(), "network-partition-7,network-partition-8");
+ algoFound = true;
+
+ }
+ }
+ if (!algoFound) {
+ assertTrue(String.format("The networkPartitionGroups property is not found in %s",
+ applicationPolicyId), false);
+ } */
+
+ boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-7", RestConstants.NETWORK_PARTITIONS_NAME);
+ //Trying to remove the used network partition
+ assertEquals(removedNet, false);
+
+ boolean removedDep = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
+ applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME);
+ assertEquals(removedDep, true);
+
+ ApplicationPolicyBean beanRemovedDep = (ApplicationPolicyBean) restClient.
+ getEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId,
+ ApplicationPolicyBean.class, RestConstants.APPLICATION_POLICIES_NAME);
+ assertEquals(beanRemovedDep, null);
+
+ boolean removedN1 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-7", RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedN1, true);
+
+ NetworkPartitionBean beanRemovedN1 = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-7",
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(beanRemovedN1, null);
+
+ boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-8", RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedN2, true);
+
+ NetworkPartitionBean beanRemovedN2 = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-8",
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(beanRemovedN2, null);
+
+ log.info("Ended deployment policy test case**************************************");
+
+ } catch (Exception e) {
+ log.error("An error occurred while handling deployment policy", e);
+ assertTrue("An error occurred while handling deployment policy", false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/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
new file mode 100644
index 0000000..96b8a57
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+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.policy.autoscale.AutoscalePolicyBean;
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Test to handle autoscaling policy CRUD operations
+ */
+public class AutoscalingPolicyTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(AutoscalingPolicyTest.class);
+ private static final String TEST_PATH = "/autoscaling-policy-test";
+
+
+ @Test
+ public void testAutoscalingPolicy() {
+ log.info("Started autoscaling policy test case**************************************");
+ String policyId = "autoscaling-policy-c0";
+ try {
+ boolean added = restClient.addEntity(TEST_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);
+ AutoscalePolicyBean bean = (AutoscalePolicyBean) restClient.
+ getEntity(RestConstants.AUTOSCALING_POLICIES, policyId,
+ AutoscalePolicyBean.class, RestConstants.AUTOSCALING_POLICIES_NAME);
+
+ assertEquals(String.format("[autoscaling-policy-id] %s is not correct", bean.getId()),
+ bean.getId(), policyId);
+ assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId),
+ bean.getLoadThresholds().getRequestsInFlight().getThreshold(), 35.0, 0.0);
+ assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),
+ bean.getLoadThresholds().getMemoryConsumption().getThreshold(), 45.0, 0.0);
+ assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),
+ bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0);
+
+ boolean updated = restClient.updateEntity(TEST_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);
+ AutoscalePolicyBean updatedBean = (AutoscalePolicyBean) restClient.getEntity(
+ RestConstants.AUTOSCALING_POLICIES, policyId,
+ AutoscalePolicyBean.class, RestConstants.AUTOSCALING_POLICIES_NAME);
+ assertEquals(String.format("[autoscaling-policy-id] %s RIF is not correct", policyId),
+ updatedBean.getLoadThresholds().getRequestsInFlight().getThreshold(), 30.0, 0.0);
+ assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId),
+ updatedBean.getLoadThresholds().getMemoryConsumption().getThreshold(), 40.0, 0.0);
+ assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),
+ updatedBean.getLoadThresholds().getLoadAverage().getThreshold(), 20.0, 0.0);
+
+ boolean removed = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
+ policyId, RestConstants.AUTOSCALING_POLICIES_NAME);
+ assertEquals(String.format("[autoscaling-policy-id] %s couldn't be removed", policyId),
+ removed, true);
+
+ AutoscalePolicyBean beanRemoved = (AutoscalePolicyBean) restClient.getEntity(
+ RestConstants.AUTOSCALING_POLICIES, policyId,
+ 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**************************************");
+ } 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/366babaf/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
new file mode 100644
index 0000000..9d13ca4
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+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.policy.deployment.DeploymentPolicyBean;
+import org.apache.stratos.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Test to handle Deployment policy CRUD operations
+ */
+public class DeploymentPolicyTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(DeploymentPolicyTest.class);
+ private static final String TEST_PATH = "/deployment-policy-test";
+
+
+ @Test
+ public void testDeploymentPolicy() {
+ try {
+ String deploymentPolicyId = "deployment-policy-2";
+ log.info("Started deployment policy test case**************************************");
+
+ boolean addedN1 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ "network-partition-5" + ".json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(addedN1, true);
+
+ boolean addedN2 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ "network-partition-6" + ".json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(addedN2, true);
+
+ boolean addedDep = restClient.addEntity(TEST_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+ deploymentPolicyId + ".json",
+ RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(addedDep, true);
+
+ DeploymentPolicyBean bean = (DeploymentPolicyBean) restClient.
+ getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId,
+ DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(bean.getId(), "deployment-policy-2");
+ assertEquals(bean.getNetworkPartitions().size(), 2);
+ assertEquals(bean.getNetworkPartitions().get(0).getId(), "network-partition-5");
+ 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-6");
+ 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(),
+ "network-partition-6-partition-1");
+ assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(), 10);
+ assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getId(),
+ "network-partition-6-partition-2");
+ assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(), 9);
+
+ //update network partition
+ boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ "network-partition-5-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 +
+ "/" + deploymentPolicyId + "-v1.json", RestConstants.DEPLOYMENT_POLICIES,
+ RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(updatedDep, true);
+
+ DeploymentPolicyBean updatedBean = (DeploymentPolicyBean) restClient.
+ getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId,
+ DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(updatedBean.getId(), "deployment-policy-2");
+ assertEquals(updatedBean.getNetworkPartitions().size(), 2);
+ assertEquals(updatedBean.getNetworkPartitions().get(0).getId(), "network-partition-5");
+ 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-6");
+ 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(),
+ "network-partition-6-partition-1");
+ assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(), 15);
+ assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getId(),
+ "network-partition-6-partition-2");
+ assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(), 5);
+
+ boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-5", RestConstants.NETWORK_PARTITIONS_NAME);
+ //Trying to remove the used network partition
+ assertEquals(removedNet, false);
+
+ boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
+ deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(removedDep, true);
+
+ DeploymentPolicyBean beanRemovedDep = (DeploymentPolicyBean) restClient.
+ getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId,
+ DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertEquals(beanRemovedDep, null);
+
+ boolean removedN1 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-5", RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedN1, true);
+
+ NetworkPartitionBean beanRemovedN1 = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-5",
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(beanRemovedN1, null);
+
+ boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ "network-partition-6", RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removedN2, true);
+
+ NetworkPartitionBean beanRemovedN2 = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-6",
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(beanRemovedN2, null);
+
+ log.info("Ended deployment policy test case**************************************");
+
+ } catch (Exception e) {
+ log.error("An error occurred while handling deployment policy", e);
+ assertTrue("An error occurred while handling deployment policy", false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/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
new file mode 100644
index 0000000..5df2313
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+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.integration.tests.RestConstants;
+import org.apache.stratos.integration.tests.StratosTestServerManager;
+import org.testng.annotations.Test;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * Test to handle Network partition CRUD operations
+ */
+public class NetworkPartitionTest extends StratosTestServerManager {
+ private static final Log log = LogFactory.getLog(NetworkPartitionTest.class);
+ private static final String TEST_PATH = "/network-partition-test";
+
+
+ @Test
+ public void testNetworkPartition() {
+ try {
+ String networkPartitionId = "network-partition-3";
+ log.info("Started network partition test case**************************************");
+
+ boolean added = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ networkPartitionId + ".json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+
+ assertEquals(added, true);
+ NetworkPartitionBean bean = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId,
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+
+ assertEquals(bean.getId(), "network-partition-3");
+ 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");
+
+ boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+ networkPartitionId + "-v1.json",
+ RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+
+ assertEquals(updated, true);
+ NetworkPartitionBean updatedBean = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId,
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(updatedBean.getId(), "network-partition-3");
+ 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");
+
+ boolean removed = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+ networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(removed, true);
+
+ NetworkPartitionBean beanRemoved = (NetworkPartitionBean) restClient.
+ getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId,
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertEquals(beanRemoved, null);
+
+ 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/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json
new file mode 100644
index 0000000..a461844
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json
@@ -0,0 +1,18 @@
+{
+ "id": "application-policy-3",
+ "algorithm": "one-after-another",
+ "networkPartitions": [
+ "network-partition-9",
+ "network-partition-10"
+ ],
+ "properties": [
+ {
+ "name": "key-1",
+ "value": "network-partition-9|network-partition-10"
+ },
+ {
+ "name": "key-2",
+ "value": "value-2"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/applications/app-bursting-single-cartriddge-group.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/applications/app-bursting-single-cartriddge-group.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/applications/app-bursting-single-cartriddge-group.json
new file mode 100644
index 0000000..4e00d60
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/applications/app-bursting-single-cartriddge-group.json
@@ -0,0 +1,70 @@
+{
+ "applicationId": "cartridge-group-app",
+ "alias": "my-cartridge-group-app",
+ "components": {
+ "groups": [
+ {
+ "name": "esb-php-group",
+ "alias": "my-esb-php-group",
+ "deploymentPolicy": "deployment-policy-4",
+ "groupMinInstances": 1,
+ "groupMaxInstances": 2,
+ "cartridges": [
+ {
+ "type": "esb",
+ "cartridgeMin": 1,
+ "cartridgeMax": 2,
+ "subscribableInfo": {
+ "alias": "my-esb",
+ "autoscalingPolicy": "autoscaling-policy-2",
+ "artifactRepository": {
+ "privateRepo": false,
+ "repoUrl": "https://github.com/imesh/stratos-esb-applications.git",
+ "repoUsername": "",
+ "repoPassword": ""
+ }
+ }
+ },
+ {
+ "type": "php",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "lvsVirtualIP": "192.168.56.50|255.255.255.0",
+ "subscribableInfo": {
+ "alias": "my-php",
+ "autoscalingPolicy": "autoscaling-policy-2",
+ "artifactRepository": {
+ "privateRepo": false,
+ "repoUrl": "https://github.com/imesh/stratos-php-applications.git",
+ "repoUsername": "",
+ "repoPassword": ""
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "cartridges": [
+ {
+ "type": "tomcat",
+ "cartridgeMin": 2,
+ "cartridgeMax": 4,
+ "subscribableInfo": {
+ "alias": "my-tomcat",
+ "autoscalingPolicy": "autoscaling-policy-2",
+ "deploymentPolicy": "deployment-policy-4",
+ "artifactRepository": {
+ "privateRepo": false,
+ "repoUrl": "https://github.com/imesh/stratos-tomcat-applications.git",
+ "repoUsername": "",
+ "repoPassword": ""
+ }
+ }
+ }
+ ],
+ "dependencies": {
+ "terminationBehaviour": "terminate-none"
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/autoscaling-policies/autoscaling-policy-2.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/autoscaling-policies/autoscaling-policy-2.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/autoscaling-policies/autoscaling-policy-2.json
new file mode 100644
index 0000000..944aa82
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/autoscaling-policies/autoscaling-policy-2.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscaling-policy-2",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 35
+ },
+ "memoryConsumption": {
+ "threshold": 45
+ },
+ "loadAverage": {
+ "threshold": 25
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges-groups/esb-php-group.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges-groups/esb-php-group.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges-groups/esb-php-group.json
new file mode 100644
index 0000000..008c735
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges-groups/esb-php-group.json
@@ -0,0 +1,19 @@
+{
+ "name": "esb-php-group",
+ "cartridges": [
+ "esb",
+ "php"
+ ],
+ "dependencies": {
+ "startupOrders": [
+ {
+ "aliases": [
+ "cartridge.my-esb",
+ "cartridge.my-php"
+ ]
+ }
+ ],
+ "terminationBehaviour": "terminate-none"
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/esb.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/esb.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/esb.json
new file mode 100755
index 0000000..571e7e1
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/esb.json
@@ -0,0 +1,50 @@
+{
+ "type": "esb",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "framework",
+ "displayName": "esb",
+ "description": "esb Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "name": "http-22",
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+ "networkInterfaces": [
+ {
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "vishanth-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "metadataKeys": [
+ "server_ip",
+ "username",
+ "password"
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/php.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/php.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/php.json
new file mode 100755
index 0000000..5d53e3a
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/php.json
@@ -0,0 +1,51 @@
+{
+ "type": "php",
+ "provider": "apache",
+ "category": "framework",
+ "host": "php.stratos.org",
+ "displayName": "php",
+ "description": "php Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "name": "http-80",
+ "protocol": "http",
+ "port": "8080",
+ "proxyPort": "8280"
+ },
+ {
+ "name": "http-22",
+ "protocol": "tcp",
+ "port": "22",
+ "proxyPort": "8222"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+ "networkInterfaces": [
+ {
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "reka"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/tomcat.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/tomcat.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/tomcat.json
new file mode 100755
index 0000000..395687d
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/tomcat.json
@@ -0,0 +1,53 @@
+{
+ "type": "tomcat",
+ "provider": "apache",
+ "host": "tomcat.stratos.org",
+ "category": "framework",
+ "displayName": "tomcat",
+ "description": "tomcat Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "name": "http-22",
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ },
+ {
+ "protocol": "http",
+ "port": "8080",
+ "proxyPort": "80"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+ "networkInterfaces": [
+ {
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "vishanth-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ],
+ "metadataKeys": [
+ "url"
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/deployment-policies/deployment-policy-4.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/deployment-policies/deployment-policy-4.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/deployment-policies/deployment-policy-4.json
new file mode 100644
index 0000000..f9935d7
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/deployment-policies/deployment-policy-4.json
@@ -0,0 +1,32 @@
+{
+ "id": "deployment-policy-4",
+ "networkPartitions": [
+ {
+ "id": "network-partition-9",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "partitionMax": 4
+ }
+ ]
+ },
+ {
+ "id": "network-partition-10",
+ "partitionAlgo": "round-robin",
+ "partitions": [
+ {
+ "id": "network-partition-10-partition-1",
+ "partitionMax": 4
+ },
+ {
+ "id": "network-partition-10-partition-2",
+ "partitionMax": 4
+ }
+ ]
+ }
+ ]
+}
+
+
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-10.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-10.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-10.json
new file mode 100644
index 0000000..1e1ec23
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-10.json
@@ -0,0 +1,24 @@
+{
+ "id": "network-partition-10",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "network-partition-10-partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ },
+ {
+ "id": "network-partition-10-partition-2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-9.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-9.json b/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-9.json
new file mode 100644
index 0000000..9f12343
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-9.json
@@ -0,0 +1,15 @@
+{
+ "id": "network-partition-9",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-policy-test/application-policies/application-policy-2.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-policy-test/application-policies/application-policy-2.json b/products/stratos/modules/integration/src/test/resources/application-policy-test/application-policies/application-policy-2.json
new file mode 100644
index 0000000..82e85a0
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-policy-test/application-policies/application-policy-2.json
@@ -0,0 +1,18 @@
+{
+ "id": "application-policy-2",
+ "algorithm": "one-after-another",
+ "networkPartitions": [
+ "network-partition-7",
+ "network-partition-8"
+ ],
+ "properties": [
+ {
+ "name": "key-1",
+ "value": "network-partition-7,network-partition-8"
+ },
+ {
+ "name": "key-2",
+ "value": "value-2"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-7.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-7.json b/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-7.json
new file mode 100644
index 0000000..6250504
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-7.json
@@ -0,0 +1,15 @@
+{
+ "id": "network-partition-7",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-8.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-8.json b/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-8.json
new file mode 100644
index 0000000..354b837
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-8.json
@@ -0,0 +1,24 @@
+{
+ "id": "network-partition-8",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "network-partition-8-partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ },
+ {
+ "id": "network-partition-8-partition-2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0-v1.json b/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0-v1.json
new file mode 100644
index 0000000..31c2b84
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0-v1.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscaling-policy-c0",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 30
+ },
+ "memoryConsumption": {
+ "threshold": 40
+ },
+ "loadAverage": {
+ "threshold": 20
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0.json b/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0.json
new file mode 100644
index 0000000..4bcef26
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/autoscaling-policy-test/autoscaling-policies/autoscaling-policy-c0.json
@@ -0,0 +1,14 @@
+{
+ "id": "autoscaling-policy-c0",
+ "loadThresholds": {
+ "requestsInFlight": {
+ "threshold": 35
+ },
+ "memoryConsumption": {
+ "threshold": 45
+ },
+ "loadAverage": {
+ "threshold": 25
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6-v1.json b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6-v1.json
new file mode 100644
index 0000000..c0132f0
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6-v1.json
@@ -0,0 +1,50 @@
+{
+ "name": "G4",
+ "dependencies": {
+ "terminationBehaviour": "terminate-none",
+ "startupOrders": [
+ {
+ "aliases": [
+ "group.group2",
+ "cartridge.c1-1x0"
+ ]
+ }
+ ]
+ },
+ "cartridges": [
+ "c4"
+ ],
+ "groups": [
+ {
+ "name": "G5",
+ "dependencies": {
+ "terminationBehaviour": "terminate-dependents",
+ "startupOrders": [
+ {
+ "aliases": [
+ "group.group6",
+ "cartridge.c5-1x0"
+ ]
+ }
+ ]
+ },
+ "cartridges": [
+ "c5"
+ ],
+ "groups": [
+ {
+ "name": "G6",
+ "dependencies": {
+ "terminationBehaviour": "terminate-all",
+ "startupOrders": []
+ },
+ "cartridges": [
+ "c6"
+ ],
+ "groups": []
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6.json b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6.json
new file mode 100644
index 0000000..ef28723
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges-groups/g4-g5-g6.json
@@ -0,0 +1,50 @@
+{
+ "name": "G4",
+ "dependencies": {
+ "terminationBehaviour": "terminate-none",
+ "startupOrders": [
+ {
+ "aliases": [
+ "group.group5",
+ "cartridge.c4-1x0"
+ ]
+ }
+ ]
+ },
+ "cartridges": [
+ "c4"
+ ],
+ "groups": [
+ {
+ "name": "G5",
+ "dependencies": {
+ "terminationBehaviour": "terminate-dependents",
+ "startupOrders": [
+ {
+ "aliases": [
+ "group.group6",
+ "cartridge.c5-1x0"
+ ]
+ }
+ ]
+ },
+ "cartridges": [
+ "c5"
+ ],
+ "groups": [
+ {
+ "name": "G6",
+ "dependencies": {
+ "terminationBehaviour": "terminate-all",
+ "startupOrders": []
+ },
+ "cartridges": [
+ "c6"
+ ],
+ "groups": []
+ }
+ ]
+ }
+ ]
+}
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c4.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c4.json b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c4.json
new file mode 100755
index 0000000..ec7d8b2
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c4.json
@@ -0,0 +1,45 @@
+{
+ "type": "c4",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c4",
+ "description": "c4 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "name": "http-22",
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+ "networkInterfaces": [
+ {
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "vishanth-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c5.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c5.json b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c5.json
new file mode 100755
index 0000000..0e438fd
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c5.json
@@ -0,0 +1,124 @@
+{
+ "category": "Application",
+ "description": "c5 Cartridge",
+ "displayName": "c5",
+ "host": "qmog.cisco.com",
+ "iaasProvider": [
+ {
+ "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f",
+ "maxInstanceLimit": "4",
+ "networkInterfaces": [
+ {
+ "floatingNetworks": [
+ {
+ "name": "public",
+ "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6"
+ }
+ ],
+ "name": "core",
+ "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809"
+ },
+ {
+ "name": "keyPair",
+ "value": "phoenix"
+ },
+ {
+ "name": "autoAssignIp",
+ "value": "false"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ],
+ "type": "mock"
+ }
+ ],
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "port": "22",
+ "protocol": "http",
+ "proxyPort": "8280"
+ }
+ ],
+ "property": [
+ {
+ "name": "payload_parameter.MB_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.MB_PORT",
+ "value": "61616"
+ },
+ {
+ "name": "payload_parameter.CEP_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.CEP_PORT",
+ "value": "7611"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_PASSWORD",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.CERT_TRUSTSTORE",
+ "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks"
+ },
+ {
+ "name": "payload_parameter.TRUSTSTORE_PASSWORD",
+ "value": "wso2carbon"
+ },
+ {
+ "name": "payload_parameter.ENABLE_DATA_PUBLISHER",
+ "value": "false"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_PORT",
+ "value": "7611"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT",
+ "value": "7711"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.QTCM_DNS_SEGMENT",
+ "value": "test"
+ },
+ {
+ "name": "payload_parameter.QTCM_NETWORK_COUNT",
+ "value": "1"
+ },
+ {
+ "name": "payload_parameter.SIMPLE_PROPERTY",
+ "value": "value"
+ }
+ ],
+ "provider": "cisco",
+ "type": "c5",
+ "version": "1.0"
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c6.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c6.json b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c6.json
new file mode 100755
index 0000000..8f41441
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-group-test/cartridges/mock/c6.json
@@ -0,0 +1,45 @@
+{
+ "type": "c6",
+ "provider": "apache",
+ "host": "stratos.apache.org",
+ "category": "data",
+ "displayName": "c6",
+ "description": "c6 Cartridge",
+ "version": "7",
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "name": "http-22",
+ "protocol": "http",
+ "port": "22",
+ "proxyPort": "8280"
+ }
+ ],
+ "deployment": {
+ },
+ "iaasProvider": [
+ {
+ "type": "mock",
+ "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+ "networkInterfaces": [
+ {
+ "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+ },
+ {
+ "name": "keyPair",
+ "value": "vishanth-key"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0-v1.json b/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0-v1.json
new file mode 100755
index 0000000..6d922a9
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0-v1.json
@@ -0,0 +1,124 @@
+{
+ "category": "Data",
+ "description": "c0 Cartridge",
+ "displayName": "c0",
+ "host": "qmog.cisco.com12",
+ "iaasProvider": [
+ {
+ "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9d123",
+ "maxInstanceLimit": "4",
+ "networkInterfaces": [
+ {
+ "floatingNetworks": [
+ {
+ "name": "private",
+ "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc2112121"
+ }
+ ],
+ "name": "core1",
+ "networkUuid": "5e107fbd-4820-47ad-84ea-6f1354961212"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb812"
+ },
+ {
+ "name": "keyPair",
+ "value": "phoenix12"
+ },
+ {
+ "name": "autoAssignIp",
+ "value": "true"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default123"
+ }
+ ],
+ "type": "mock"
+ }
+ ],
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "port": "22",
+ "protocol": "http",
+ "proxyPort": "8280"
+ }
+ ],
+ "property": [
+ {
+ "name": "payload_parameter.MB_IP",
+ "value": "octl.qmog.cisco.com123"
+ },
+ {
+ "name": "payload_parameter.MB_PORT",
+ "value": "61617"
+ },
+ {
+ "name": "payload_parameter.CEP_IP",
+ "value": "octl.qmog.cisco.com123"
+ },
+ {
+ "name": "payload_parameter.CEP_PORT",
+ "value": "7612"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_PASSWORD",
+ "value": "admin123"
+ },
+ {
+ "name": "payload_parameter.CERT_TRUSTSTORE",
+ "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks"
+ },
+ {
+ "name": "payload_parameter.TRUSTSTORE_PASSWORD",
+ "value": "wso2carbon"
+ },
+ {
+ "name": "payload_parameter.ENABLE_DATA_PUBLISHER",
+ "value": "false"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_IP",
+ "value": "octl.qmog.cisco.com123"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_PORT",
+ "value": "7612"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT",
+ "value": "7712"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD",
+ "value": "admin123"
+ },
+ {
+ "name": "payload_parameter.QTCM_DNS_SEGMENT",
+ "value": "test123"
+ },
+ {
+ "name": "payload_parameter.QTCM_NETWORK_COUNT",
+ "value": "3"
+ },
+ {
+ "name": "payload_parameter.SIMPLE_PROPERTY",
+ "value": "value"
+ }
+ ],
+ "provider": "apache",
+ "type": "c0",
+ "version": "1.0"
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0.json b/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0.json
new file mode 100755
index 0000000..44066e1
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/cartridge-test/cartridges/mock/c0.json
@@ -0,0 +1,124 @@
+{
+ "category": "Application",
+ "description": "c0 Cartridge",
+ "displayName": "c0",
+ "host": "qmog.cisco.com",
+ "iaasProvider": [
+ {
+ "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f",
+ "maxInstanceLimit": "4",
+ "networkInterfaces": [
+ {
+ "floatingNetworks": [
+ {
+ "name": "public",
+ "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6"
+ }
+ ],
+ "name": "core",
+ "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889"
+ }
+ ],
+ "property": [
+ {
+ "name": "instanceType",
+ "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809"
+ },
+ {
+ "name": "keyPair",
+ "value": "phoenix"
+ },
+ {
+ "name": "autoAssignIp",
+ "value": "false"
+ },
+ {
+ "name": "securityGroups",
+ "value": "default"
+ }
+ ],
+ "type": "mock"
+ }
+ ],
+ "multiTenant": "false",
+ "portMapping": [
+ {
+ "port": "22",
+ "protocol": "http",
+ "proxyPort": "8280"
+ }
+ ],
+ "property": [
+ {
+ "name": "payload_parameter.MB_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.MB_PORT",
+ "value": "61616"
+ },
+ {
+ "name": "payload_parameter.CEP_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.CEP_PORT",
+ "value": "7611"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.CEP_ADMIN_PASSWORD",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.CERT_TRUSTSTORE",
+ "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks"
+ },
+ {
+ "name": "payload_parameter.TRUSTSTORE_PASSWORD",
+ "value": "wso2carbon"
+ },
+ {
+ "name": "payload_parameter.ENABLE_DATA_PUBLISHER",
+ "value": "false"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_IP",
+ "value": "octl.qmog.cisco.com"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_PORT",
+ "value": "7611"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT",
+ "value": "7711"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD",
+ "value": "admin"
+ },
+ {
+ "name": "payload_parameter.QTCM_DNS_SEGMENT",
+ "value": "test"
+ },
+ {
+ "name": "payload_parameter.QTCM_NETWORK_COUNT",
+ "value": "1"
+ },
+ {
+ "name": "payload_parameter.SIMPLE_PROPERTY",
+ "value": "value"
+ }
+ ],
+ "provider": "cisco",
+ "type": "c0",
+ "version": "1.0"
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2-v1.json b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2-v1.json
new file mode 100644
index 0000000..b5c305c
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2-v1.json
@@ -0,0 +1,36 @@
+{
+ "id": "deployment-policy-2",
+ "networkPartitions": [
+ {
+ "id": "network-partition-5",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "partitionMax": 25
+ },
+ {
+ "id": "partition-2",
+ "partitionMax": 20
+ }
+ ]
+ },
+ {
+ "id": "network-partition-6",
+ "partitionAlgo": "round-robin",
+ "partitions": [
+ {
+ "id": "network-partition-6-partition-1",
+ "partitionMax": 15
+ },
+ {
+ "id": "network-partition-6-partition-2",
+ "partitionMax": 5
+ }
+ ]
+ }
+ ]
+}
+
+
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2.json b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2.json
new file mode 100644
index 0000000..5df3e24
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-2.json
@@ -0,0 +1,32 @@
+{
+ "id": "deployment-policy-2",
+ "networkPartitions": [
+ {
+ "id": "network-partition-5",
+ "partitionAlgo": "one-after-another",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "partitionMax": 20
+ }
+ ]
+ },
+ {
+ "id": "network-partition-6",
+ "partitionAlgo": "round-robin",
+ "partitions": [
+ {
+ "id": "network-partition-6-partition-1",
+ "partitionMax": 10
+ },
+ {
+ "id": "network-partition-6-partition-2",
+ "partitionMax": 9
+ }
+ ]
+ }
+ ]
+}
+
+
+
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5-v1.json b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5-v1.json
new file mode 100644
index 0000000..275b536
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5-v1.json
@@ -0,0 +1,28 @@
+{
+ "id": "network-partition-5",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ },
+ {
+ "id": "partition-2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default1"
+ },
+ {
+ "name": "zone",
+ "value": "z1"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5.json b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5.json
new file mode 100644
index 0000000..5464aa9
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-5.json
@@ -0,0 +1,15 @@
+{
+ "id": "network-partition-5",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-6.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-6.json b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-6.json
new file mode 100644
index 0000000..d200b70
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/deployment-policy-test/network-partitions/mock/network-partition-6.json
@@ -0,0 +1,24 @@
+{
+ "id": "network-partition-6",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "network-partition-6-partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ },
+ {
+ "id": "network-partition-6-partition-2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/366babaf/products/stratos/modules/integration/src/test/resources/network-partition-test/network-partitions/mock/network-partition-3-v1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/resources/network-partition-test/network-partitions/mock/network-partition-3-v1.json b/products/stratos/modules/integration/src/test/resources/network-partition-test/network-partitions/mock/network-partition-3-v1.json
new file mode 100644
index 0000000..c7d4733
--- /dev/null
+++ b/products/stratos/modules/integration/src/test/resources/network-partition-test/network-partitions/mock/network-partition-3-v1.json
@@ -0,0 +1,28 @@
+{
+ "id": "network-partition-3",
+ "provider": "mock",
+ "partitions": [
+ {
+ "id": "partition-1",
+ "property": [
+ {
+ "name": "region",
+ "value": "default"
+ }
+ ]
+ },
+ {
+ "id": "partition-2",
+ "property": [
+ {
+ "name": "region",
+ "value": "default1"
+ },
+ {
+ "name": "zone",
+ "value": "z1"
+ }
+ ]
+ }
+ ]
+}