http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java index 2fd4100..f5fba7c 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java @@ -21,201 +21,168 @@ package org.apache.stratos.integration.tests.application; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.common.beans.application.ApplicationBean; -import org.apache.stratos.common.beans.cartridge.CartridgeGroupBean; import org.apache.stratos.common.beans.policy.deployment.ApplicationPolicyBean; import org.apache.stratos.integration.tests.RestConstants; import org.apache.stratos.integration.tests.StratosTestServerManager; import org.apache.stratos.integration.tests.TopologyHandler; +import org.apache.stratos.messaging.domain.application.Application; +import org.apache.stratos.messaging.domain.application.ApplicationStatus; +import org.apache.stratos.messaging.domain.application.ClusterDataHolder; +import org.apache.stratos.messaging.domain.instance.ClusterInstance; +import org.apache.stratos.messaging.domain.topology.Cluster; +import org.apache.stratos.messaging.domain.topology.Member; +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.annotations.Test; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; +import java.util.Set; + +import static junit.framework.Assert.*; /** * This will handle the scale-up and scale-down of a particular cluster bursting test cases */ public class SingleClusterScalingTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(SampleApplicationsTest.class); - private static final String TEST_PATH = "/application-bursting-test"; + private static final String RESOURCES_PATH = "/single-cluster-scaling-test"; + private static final int CLUSTER_SCALE_UP_TIMEOUT = 180000; @Test public void testDeployApplication() { try { - log.info("Started application Bursting test case**************************************"); + log.info("-------------------------------Started application Bursting test case-------------------------------"); - String autoscalingPolicyId = "autoscaling-policy-2"; + String autoscalingPolicyId = "autoscaling-policy-single-cluster-scaling-test"; - boolean addedScalingPolicy = restClient.addEntity(TEST_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(addedScalingPolicy, true); - boolean addedC1 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "esb.json", + boolean addedC1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c7-single-cluster-scaling-test.json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertEquals(addedC1, true); - boolean addedC2 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "php.json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); - assertEquals(addedC2, true); - - boolean addedC3 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "tomcat.json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); - assertEquals(addedC3, true); - - boolean addedG1 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + "esb-php-group.json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); - assertEquals(addedG1, true); - - CartridgeGroupBean beanG1 = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, "esb-php-group", - CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); - assertEquals(beanG1.getName(), "esb-php-group"); - - boolean addedN1 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-9.json", + boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-single-cluster-scaling-test.json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN1, true); - boolean addedN2 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-10.json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); - assertEquals(addedN2, true); - - boolean addedDep = restClient.addEntity(TEST_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - "deployment-policy-4.json", + boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + + "deployment-policy-single-cluster-scaling-test.json", RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(addedDep, true); - boolean added = restClient.addEntity(TEST_PATH + RestConstants.APPLICATIONS_PATH + "/" + - "app-bursting-single-cartriddge-group.json", RestConstants.APPLICATIONS, + boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + + "single-cluster-scaling-test.json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); assertEquals(added, true); ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - "cartridge-group-app", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); - assertEquals(bean.getApplicationId(), "cartridge-group-app"); + "single-cluster-scaling-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + assertEquals(bean.getApplicationId(), "single-cluster-scaling-test"); - boolean addAppPolicy = restClient.addEntity(TEST_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + - "application-policy-3.json", RestConstants.APPLICATION_POLICIES, + boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + + "application-policy-single-cluster-scaling-test.json", RestConstants.APPLICATION_POLICIES, RestConstants.APPLICATION_POLICIES_NAME); assertEquals(addAppPolicy, true); ApplicationPolicyBean policyBean = (ApplicationPolicyBean) restClient.getEntity( RestConstants.APPLICATION_POLICIES, - "application-policy-3", ApplicationPolicyBean.class, + "application-policy-single-cluster-scaling-test", ApplicationPolicyBean.class, RestConstants.APPLICATION_POLICIES_NAME); //deploy the application - String resourcePath = RestConstants.APPLICATIONS + "/" + "cartridge-group-app" + - RestConstants.APPLICATIONS_DEPLOY + "/" + "application-policy-3"; + String resourcePath = RestConstants.APPLICATIONS + "/" + "single-cluster-scaling-test" + + RestConstants.APPLICATIONS_DEPLOY + "/" + "application-policy-single-cluster-scaling-test"; boolean deployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); assertEquals(deployed, true); //Application active handling - TopologyHandler.getInstance().assertApplicationActivation(bean.getApplicationId()); - - //Group active handling - TopologyHandler.getInstance().assertGroupActivation(bean.getApplicationId()); + TopologyHandler.getInstance().assertApplicationStatus(bean.getApplicationId() + , ApplicationStatus.Active); //Cluster active handling TopologyHandler.getInstance().assertClusterActivation(bean.getApplicationId()); - boolean removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, "esb-php-group", - RestConstants.CARTRIDGE_GROUPS_NAME); - assertEquals(removedGroup, false); + //Verifying whether members got created using round robin algorithm + assertClusterWithScalingup(bean.getApplicationId()); boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(removedAuto, false); boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-9", + "network-partition-single-cluster-scaling-test", RestConstants.NETWORK_PARTITIONS_NAME); //Trying to remove the used network partition assertEquals(removedNet, false); boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - "deployment-policy-4", RestConstants.DEPLOYMENT_POLICIES_NAME); + "deployment-policy-single-cluster-scaling-test", RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(removedDep, false); //Un-deploying the application - String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + "cartridge-group-app" + + String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + "single-cluster-scaling-test" + RestConstants.APPLICATIONS_UNDEPLOY; boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME); assertEquals(unDeployed, true); - boolean undeploy = TopologyHandler.getInstance().assertApplicationUndeploy("cartridge-group-app"); + boolean undeploy = TopologyHandler.getInstance().assertApplicationUndeploy("single-cluster-scaling-test"); if (!undeploy) { //Need to forcefully undeploy the application - log.info("Force undeployment is going to start for the [application] " + "cartridge-group-app"); + log.info("Force undeployment is going to start for the [application] " + "single-cluster-scaling-test"); - restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + "cartridge-group-app" + + restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + "single-cluster-scaling-test" + RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); - boolean forceUndeployed = TopologyHandler.getInstance().assertApplicationUndeploy("cartridge-group-app"); + boolean forceUndeployed = TopologyHandler.getInstance().assertApplicationUndeploy("single-cluster-scaling-test"); assertEquals(String.format("Forceful undeployment failed for the application %s", - "cartridge-group-app"), forceUndeployed, true); + "single-cluster-scaling-test"), forceUndeployed, true); } - boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, "cartridge-group-app", + boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, "single-cluster-scaling-test", RestConstants.APPLICATIONS_NAME); assertEquals(removed, true); ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - "cartridge-group-app", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + "single-cluster-scaling-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); assertEquals(beanRemoved, null); - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, "esb-php-group", - RestConstants.CARTRIDGE_GROUPS_NAME); - assertEquals(removedGroup, true); - - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "esb", + boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c7-single-cluster-scaling-test", RestConstants.CARTRIDGES_NAME); assertEquals(removedC1, true); - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "php", - RestConstants.CARTRIDGES_NAME); - assertEquals(removedC2, true); - - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "tomcat", - RestConstants.CARTRIDGES_NAME); - assertEquals(removedC3, true); removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(removedAuto, true); removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - "deployment-policy-4", RestConstants.DEPLOYMENT_POLICIES_NAME); + "deployment-policy-single-cluster-scaling-test", RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(removedDep, true); removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-9", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-single-cluster-scaling-test", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedNet, false); - boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-10", RestConstants.NETWORK_PARTITIONS_NAME); - assertEquals(removedN2, false); boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, - "application-policy-3", RestConstants.APPLICATION_POLICIES_NAME); + "application-policy-single-cluster-scaling-test", RestConstants.APPLICATION_POLICIES_NAME); assertEquals(removeAppPolicy, true); removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-9", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-single-cluster-scaling-test", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedNet, true); - removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-10", RestConstants.NETWORK_PARTITIONS_NAME); - assertEquals(removedN2, true); - - log.info("Ended application bursting test case**************************************"); + log.info("-------------------------Ended application bursting test case-------------------------"); } catch (Exception e) { log.error("An error occurred while handling application bursting", e); @@ -223,11 +190,55 @@ public class SingleClusterScalingTest extends StratosTestServerManager { } } - @Test(dependsOnMethods = {"testApplication"}) - public void testClusterScalingUp() { - + /** + * Assert application activation + * + * @param applicationName + */ + private void assertClusterWithScalingup(String applicationName) { + Application application = ApplicationManager.getApplications().getApplication(applicationName); + assertNotNull(String.format("Application is not found: [application-id] %s", + applicationName), application); + boolean clusterScaleup = false; + String clusterId = null; + long startTime = System.currentTimeMillis(); + while (!clusterScaleup) { + try { + Thread.sleep(1000); + } catch (InterruptedException ignore) { + } + Set<ClusterDataHolder> clusterDataHolderSet = application.getClusterDataRecursively(); + for (ClusterDataHolder clusterDataHolder : clusterDataHolderSet) { + String serviceName = clusterDataHolder.getServiceType(); + clusterId = clusterDataHolder.getClusterId(); + Service service = TopologyManager.getTopology().getService(serviceName); + assertNotNull(String.format("Service is not found: [application-id] %s [service] %s", + applicationName, serviceName), service); + + Cluster cluster = service.getCluster(clusterId); + assertNotNull(String.format("Cluster is not found: [application-id] %s [service] %s [cluster-id] %s", + applicationName, serviceName, clusterId), cluster); + for (ClusterInstance instance : cluster.getInstanceIdToInstanceContextMap().values()) { + int activeInstances = 0; + for (Member member : cluster.getMembers()) { + if (member.getClusterInstanceId().equals(instance.getInstanceId())) { + if (member.getStatus().equals(MemberStatus.Active)) { + activeInstances++; + } + } + } + clusterScaleup = activeInstances > clusterDataHolder.getMinInstances(); + if(clusterScaleup) { + break; + } + } + application = ApplicationManager.getApplications().getApplication(applicationName); + if ((System.currentTimeMillis() - startTime) > CLUSTER_SCALE_UP_TIMEOUT) { + break; + } + } + } + assertEquals(String.format("Cluster did not get scaled up: [cluster-id] %s", clusterId), + clusterScaleup, true); } - - - }
http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java deleted file mode 100644 index ce23728..0000000 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationBean.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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.config; - -/** - * Created by reka on 5/7/15. - */ -public class ApplicationBean { -} http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java deleted file mode 100644 index ace17e6..0000000 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/config/ApplicationConfigParser.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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.config; - -/** - * Created by reka on 5/7/15. - */ -public class ApplicationConfigParser { -} http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java index 4cd3235..ccaeaf6 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java @@ -34,92 +34,100 @@ import static junit.framework.Assert.assertTrue; */ public class CartridgeGroupTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(CartridgeGroupTest.class); - private static final String TEST_PATH = "/cartridge-group-test"; + private static final String RESOURCES_PATH = "/cartridge-group-test"; @Test public void testCartridgeGroup() { try { - log.info("Started Cartridge group test case**************************************"); + log.info("-------------------------Started Cartridge group test case-------------------------"); - boolean addedC1 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c4.json", + boolean addedC1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + + "/" + "c4-cartridge-group-test.json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); - assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c4"), addedC1, true); + assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", + "c4-cartridge-group-test"), addedC1, true); - boolean addedC2 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c5.json", + boolean addedC2 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + + "/" + "c5-cartridge-group-test.json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); - assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c5"), addedC2, true); + assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", + "c5-cartridge-group-test"), addedC2, true); - boolean addedC3 = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c6.json", + boolean addedC3 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + + "/" + "c6-cartridge-group-test.json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); - assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", "c6"), addedC3, true); + assertEquals(String.format("Cartridge did not added: [cartridge-name] %s", + "c6-cartridge-group-test"), addedC3, true); - boolean added = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + "g4-g5-g6.json", RestConstants.CARTRIDGE_GROUPS, + boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + + "/" + "g4-g5-g6-cartridge-group-test.json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge Group did not added: [cartridge-group-name] %s", - "g4-g5-g6"), added, true); + "g4-g5-g6-cartridge-group-test"), added, true); + CartridgeGroupBean bean = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, "G4", + getEntity(RestConstants.CARTRIDGE_GROUPS, "G4-cartridge-group-test", CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge Group name did not match: [cartridge-group-name] %s", - "g4-g5-g6.json"), bean.getName(), "G4"); + "g4-g5-g6-cartridge-group-test.json"), bean.getName(), "G4-cartridge-group-test"); - boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + "g4-g5-g6-v1.json", + boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + + "/" + "g4-g5-g6-cartridge-group-test-v1.json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge Group did not updated: [cartridge-group-name] %s", - "g4-g5-g6"), updated, true); + "g4-g5-g6-cartridge-group-test"), updated, true); + CartridgeGroupBean updatedBean = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, "G4", + getEntity(RestConstants.CARTRIDGE_GROUPS, "G4-cartridge-group-test", CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Updated Cartridge Group didn't match: [cartridge-group-name] %s", - "g4-g5-g6"), updatedBean.getName(), "G4"); + "g4-g5-g6-cartridge-group-test"), updatedBean.getName(), "G4-cartridge-group-test"); - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c4", + boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c4-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can be removed while it is used in " + - "cartridge group: [cartridge-name] %s", "c4"), removedC1, false); + "cartridge group: [cartridge-name] %s", "c4-cartridge-group-test"), removedC1, false); - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "c5", + boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "c5-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can be removed while it is used in " + "cartridge group: [cartridge-name] %s", - "c5"), removedC2, false); + "c5-cartridge-group-test"), removedC2, false); - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "c6", + boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "c6-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can be removed while it is used in " + "cartridge group: [cartridge-name] %s", - "c6"), removedC3, false); + "c6-cartridge-group-test"), removedC3, false); - boolean removed = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, "G4", + boolean removed = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, "G4-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge Group did not removed: [cartridge-group-name] %s", - "g4-g5-g6"), removed, true); + "g4-g5-g6-cartridge-group-test"), removed, true); CartridgeGroupBean beanRemoved = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, "G4", + getEntity(RestConstants.CARTRIDGE_GROUPS, "G4-cartridge-group-test", CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge Group did not removed completely: " + "[cartridge-group-name] %s", - "g4-g5-g6"), beanRemoved, null); + "g4-g5-g6-cartridge-group-test"), beanRemoved, null); - removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c4", + removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c4-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s", - "c4"), removedC1, true); + "c4-cartridge-group-test"), removedC1, true); - removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "c5", + removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, "c5-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s", - "c5"), removedC2, true); + "c5-cartridge-group-test"), removedC2, true); - removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "c6", + removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, "c6-cartridge-group-test", RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(String.format("Cartridge can not be removed : [cartridge-name] %s", - "c6"), removedC3, true); + "c6-cartridge-group-test"), removedC3, true); - log.info("Ended Cartridge group test case**************************************"); + log.info("-------------------------Ended Cartridge group test case-------------------------"); } catch (Exception e) { log.error("An error occurred while handling Cartridge group test case", e); http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java index e861e12..ac39161 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java @@ -35,16 +35,16 @@ import static junit.framework.Assert.assertTrue; */ public class CartridgeTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(CartridgeTest.class); - private static final String TEST_PATH = "/cartridge-test"; + private static final String RESOURCES_PATH = "/cartridge-test"; @Test public void testCartridge() { - log.info("Started Cartridge test case**************************************"); + log.info("--------------------Started Cartridge test case-----------------------------"); try { - String cartridgeType = "c0"; - boolean added = restClient.addEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + + String cartridgeType = "c0-cartridge-test"; + boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeType + ".json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertEquals(added, true); @@ -78,14 +78,14 @@ public class CartridgeTest extends StratosTestServerManager { } - boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.CARTRIDGES_PATH + "/" + + boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeType + "-v1.json", RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertEquals(updated, true); CartridgeBean updatedBean = (CartridgeBean) restClient. getEntity(RestConstants.CARTRIDGES, cartridgeType, CartridgeBean.class, RestConstants.CARTRIDGES_NAME); - assertEquals(updatedBean.getType(), "c0"); + assertEquals(updatedBean.getType(), "c0-cartridge-test"); assertEquals(updatedBean.getCategory(), "Data"); assertEquals(updatedBean.getHost(), "qmog.cisco.com12"); for (PropertyBean property : updatedBean.getProperty()) { @@ -121,7 +121,7 @@ public class CartridgeTest extends StratosTestServerManager { CartridgeBean.class, RestConstants.CARTRIDGES_NAME); assertEquals(beanRemoved, null); - log.info("Ended Cartridge test case**************************************"); + 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/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java index 4ed2a2e..bced0ff 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java @@ -36,26 +36,26 @@ import static junit.framework.Assert.assertTrue; */ public class ApplicationPolicyTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(ApplicationPolicyTest.class); - private static final String TEST_PATH = "/application-policy-test"; + private static final String RESOURCES_PATH = "/application-policy-test"; @Test public void testApplicationPolicy() { try { - String applicationPolicyId = "application-policy-2"; - log.info("Started Application policy test case**************************************"); + String applicationPolicyId = "application-policy-application-policy-test"; + log.info("-------------------------Started Application policy test case-------------------------"); - boolean addedN1 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-7" + ".json", + boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-application-policy-test-1" + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN1, true); - boolean addedN2 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-8" + ".json", + boolean addedN2 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-application-policy-test-2" + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN2, true); - boolean addedDep = restClient.addEntity(TEST_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + + boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + applicationPolicyId + ".json", RestConstants.APPLICATION_POLICIES, RestConstants.APPLICATION_POLICIES_NAME); assertEquals(addedDep, true); @@ -71,17 +71,17 @@ public class ApplicationPolicyTest extends StratosTestServerManager { 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"); + "network-partition-application-policy-test-1", applicationPolicyId), bean.getNetworkPartitions()[0], + "network-partition-application-policy-test-1"); assertEquals(String.format("The Second network partition is not %s in %s", - "network-partition-8", applicationPolicyId), bean.getNetworkPartitions()[1], - "network-partition-8"); + "network-partition-application-policy-test-2", applicationPolicyId), bean.getNetworkPartitions()[1], + "network-partition-application-policy-test-2"); 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"); + "network-partition-application-policy-test-1,network-partition-application-policy-test-2", applicationPolicyId), + propertyBean.getValue(), "network-partition-application-policy-test-1,network-partition-application-policy-test-2"); algoFound = true; } @@ -92,7 +92,7 @@ public class ApplicationPolicyTest extends StratosTestServerManager { } boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-7", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-application-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME); //Trying to remove the used network partition assertEquals(removedNet, false); @@ -106,24 +106,24 @@ public class ApplicationPolicyTest extends StratosTestServerManager { assertEquals(beanRemovedDep, null); boolean removedN1 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-7", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-application-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN1, true); NetworkPartitionBean beanRemovedN1 = (NetworkPartitionBean) restClient. - getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-7", + getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-application-policy-test-1", NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(beanRemovedN1, null); boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-8", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-application-policy-test-2", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN2, true); NetworkPartitionBean beanRemovedN2 = (NetworkPartitionBean) restClient. - getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-8", + getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-application-policy-test-2", NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(beanRemovedN2, null); - log.info("Ended deployment policy test case**************************************"); + log.info("-------------------------Ended deployment policy test case-------------------------"); } catch (Exception e) { log.error("An error occurred while handling deployment policy", e); http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java index 96b8a57..9a164c5 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java @@ -33,15 +33,15 @@ import static junit.framework.Assert.assertTrue; */ public class AutoscalingPolicyTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(AutoscalingPolicyTest.class); - private static final String TEST_PATH = "/autoscaling-policy-test"; + private static final String RESOURCES_PATH = "/autoscaling-policy-test"; @Test public void testAutoscalingPolicy() { - log.info("Started autoscaling policy test case**************************************"); - String policyId = "autoscaling-policy-c0"; + log.info("-------------------------Started autoscaling policy test case-------------------------"); + String policyId = "autoscaling-policy-autoscaling-policy-test"; try { - boolean added = restClient.addEntity(TEST_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + ".json", + boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(String.format("Autoscaling policy did not added: [autoscaling-policy-id] %s", policyId), added, true); @@ -58,7 +58,7 @@ public class AutoscalingPolicyTest extends StratosTestServerManager { assertEquals(String.format("[autoscaling-policy-id] %s Load is not correct", policyId), bean.getLoadThresholds().getLoadAverage().getThreshold(), 25.0, 0.0); - boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + "-v1.json", + boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + policyId + "-v1.json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(String.format("[autoscaling-policy-id] %s update failed", policyId), updated, true); @@ -82,7 +82,7 @@ public class AutoscalingPolicyTest extends StratosTestServerManager { AutoscalePolicyBean.class, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(String.format("[autoscaling-policy-id] %s didn't get removed successfully", policyId), beanRemoved, null); - log.info("Ended autoscaling policy test case**************************************"); + log.info("-------------------------Ended autoscaling policy test case---------------------------"); } catch (Exception e) { log.error("An error occurred while handling [autoscaling policy] " + policyId, e); assertTrue("An error occurred while handling [autoscaling policy] " + policyId, false); http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java index 9d13ca4..4401443 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java @@ -22,6 +22,8 @@ package org.apache.stratos.integration.tests.policies; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.common.beans.partition.NetworkPartitionBean; +import org.apache.stratos.common.beans.partition.NetworkPartitionReferenceBean; +import org.apache.stratos.common.beans.partition.PartitionReferenceBean; import org.apache.stratos.common.beans.policy.deployment.DeploymentPolicyBean; import org.apache.stratos.integration.tests.RestConstants; import org.apache.stratos.integration.tests.StratosTestServerManager; @@ -35,26 +37,26 @@ import static junit.framework.Assert.assertTrue; */ public class DeploymentPolicyTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(DeploymentPolicyTest.class); - private static final String TEST_PATH = "/deployment-policy-test"; + private static final String RESOURCES_PATH = "/deployment-policy-test"; @Test public void testDeploymentPolicy() { try { - String deploymentPolicyId = "deployment-policy-2"; - log.info("Started deployment policy test case**************************************"); + String deploymentPolicyId = "deployment-policy-deployment-policy-test"; + log.info("-------------------------Started deployment policy test case-------------------------"); - boolean addedN1 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-5" + ".json", + boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-deployment-policy-test-1" + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN1, true); - boolean addedN2 = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-6" + ".json", + boolean addedN2 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-deployment-policy-test-2" + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN2, true); - boolean addedDep = restClient.addEntity(TEST_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + + boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + deploymentPolicyId + ".json", RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(addedDep, true); @@ -62,32 +64,39 @@ public class DeploymentPolicyTest extends StratosTestServerManager { DeploymentPolicyBean bean = (DeploymentPolicyBean) restClient. getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME); - assertEquals(bean.getId(), "deployment-policy-2"); + + NetworkPartitionReferenceBean nw1 = bean.getNetworkPartitions().get(0); + NetworkPartitionReferenceBean nw2 = bean.getNetworkPartitions().get(1); + PartitionReferenceBean nw1P1 = nw1.getPartitions().get(0); + PartitionReferenceBean nw2P1 = nw2.getPartitions().get(0); + PartitionReferenceBean nw2P2 = nw2.getPartitions().get(1); + + assertEquals(bean.getId(), "deployment-policy-deployment-policy-test"); assertEquals(bean.getNetworkPartitions().size(), 2); - assertEquals(bean.getNetworkPartitions().get(0).getId(), "network-partition-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(), + assertEquals(nw1.getId(), "network-partition-deployment-policy-test-1"); + assertEquals(nw1.getPartitionAlgo(), "one-after-another"); + assertEquals(nw1.getPartitions().size(), 1); + assertEquals(nw1P1.getId(), "partition-1"); + assertEquals(nw1P1.getPartitionMax(), 20); + + assertEquals(nw2.getId(), "network-partition-deployment-policy-test-2"); + assertEquals(nw2.getPartitionAlgo(), "round-robin"); + assertEquals(nw2.getPartitions().size(), 2); + assertEquals(nw2P1.getId(), "network-partition-6-partition-1"); - assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(), 10); - assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getId(), + assertEquals(nw2P1.getPartitionMax(), 10); + assertEquals(nw2P2.getId(), "network-partition-6-partition-2"); - assertEquals(bean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(), 9); + assertEquals(nw2P2.getPartitionMax(), 9); //update network partition - boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - "network-partition-5-v1.json", + boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + "network-partition-deployment-policy-test-1-v1.json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(updated, true); //update deployment policy with new partition and max values - boolean updatedDep = restClient.updateEntity(TEST_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + + boolean updatedDep = restClient.updateEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + deploymentPolicyId + "-v1.json", RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(updatedDep, true); @@ -95,28 +104,36 @@ public class DeploymentPolicyTest extends StratosTestServerManager { DeploymentPolicyBean updatedBean = (DeploymentPolicyBean) restClient. getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME); - assertEquals(updatedBean.getId(), "deployment-policy-2"); + + nw1 = updatedBean.getNetworkPartitions().get(0); + nw2 = updatedBean.getNetworkPartitions().get(1); + nw1P1 = nw1.getPartitions().get(0); + PartitionReferenceBean nw1P2 = nw1.getPartitions().get(1); + nw2P1 = nw2.getPartitions().get(0); + nw2P2 = nw2.getPartitions().get(1); + + assertEquals(updatedBean.getId(), "deployment-policy-deployment-policy-test"); assertEquals(updatedBean.getNetworkPartitions().size(), 2); - assertEquals(updatedBean.getNetworkPartitions().get(0).getId(), "network-partition-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(), + assertEquals(nw1.getId(), "network-partition-deployment-policy-test-1"); + assertEquals(nw1.getPartitionAlgo(), "one-after-another"); + assertEquals(nw1.getPartitions().size(), 2); + assertEquals(nw1P1.getId(), "partition-1"); + assertEquals(nw1P1.getPartitionMax(), 25); + assertEquals(nw1P2.getId(), "partition-2"); + assertEquals(nw1P2.getPartitionMax(), 20); + + assertEquals(nw2.getId(), "network-partition-deployment-policy-test-2"); + assertEquals(nw2.getPartitionAlgo(), "round-robin"); + assertEquals(nw2.getPartitions().size(), 2); + assertEquals(nw2P1.getId(), "network-partition-6-partition-1"); - assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(0).getPartitionMax(), 15); - assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getId(), + assertEquals(nw2P1.getPartitionMax(), 15); + assertEquals(nw2P2.getId(), "network-partition-6-partition-2"); - assertEquals(updatedBean.getNetworkPartitions().get(1).getPartitions().get(1).getPartitionMax(), 5); + assertEquals(nw2P2.getPartitionMax(), 5); boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-5", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-deployment-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME); //Trying to remove the used network partition assertEquals(removedNet, false); @@ -130,24 +147,24 @@ public class DeploymentPolicyTest extends StratosTestServerManager { assertEquals(beanRemovedDep, null); boolean removedN1 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-5", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-deployment-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN1, true); NetworkPartitionBean beanRemovedN1 = (NetworkPartitionBean) restClient. - getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-5", + getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-deployment-policy-test-1", NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(beanRemovedN1, null); boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - "network-partition-6", RestConstants.NETWORK_PARTITIONS_NAME); + "network-partition-deployment-policy-test-2", RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN2, true); NetworkPartitionBean beanRemovedN2 = (NetworkPartitionBean) restClient. - getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-6", + getEntity(RestConstants.NETWORK_PARTITIONS, "network-partition-deployment-policy-test-2", NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(beanRemovedN2, null); - log.info("Ended deployment policy test case**************************************"); + log.info("-------------------------Ended deployment policy test case-------------------------"); } catch (Exception e) { log.error("An error occurred while handling deployment policy", e); http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java index 5df2313..684dc03 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java @@ -22,6 +22,8 @@ package org.apache.stratos.integration.tests.policies; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.common.beans.partition.NetworkPartitionBean; +import org.apache.stratos.common.beans.partition.NetworkPartitionReferenceBean; +import org.apache.stratos.common.beans.partition.PartitionBean; import org.apache.stratos.integration.tests.RestConstants; import org.apache.stratos.integration.tests.StratosTestServerManager; import org.testng.annotations.Test; @@ -34,16 +36,16 @@ import static junit.framework.Assert.assertTrue; */ public class NetworkPartitionTest extends StratosTestServerManager { private static final Log log = LogFactory.getLog(NetworkPartitionTest.class); - private static final String TEST_PATH = "/network-partition-test"; + private static final String RESOURCES_PATH = "/network-partition-test"; @Test public void testNetworkPartition() { try { - String networkPartitionId = "network-partition-3"; - log.info("Started network partition test case**************************************"); + String networkPartitionId = "network-partition-network-partition-test"; + log.info("-------------------------Started network partition test case-------------------------"); - boolean added = restClient.addEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + networkPartitionId + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); @@ -52,13 +54,14 @@ public class NetworkPartitionTest extends StratosTestServerManager { getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId, NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); - assertEquals(bean.getId(), "network-partition-3"); + PartitionBean p1 = bean.getPartitions().get(0); + assertEquals(bean.getId(), "network-partition-network-partition-test"); assertEquals(bean.getPartitions().size(), 1); - assertEquals(bean.getPartitions().get(0).getId(), "partition-1"); - assertEquals(bean.getPartitions().get(0).getProperty().get(0).getName(), "region"); - assertEquals(bean.getPartitions().get(0).getProperty().get(0).getValue(), "default"); + assertEquals(p1.getId(), "partition-1"); + assertEquals(p1.getProperty().get(0).getName(), "region"); + assertEquals(p1.getProperty().get(0).getValue(), "default"); - boolean updated = restClient.updateEntity(TEST_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + + boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + networkPartitionId + "-v1.json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); @@ -66,13 +69,15 @@ public class NetworkPartitionTest extends StratosTestServerManager { NetworkPartitionBean updatedBean = (NetworkPartitionBean) restClient. getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId, NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); - assertEquals(updatedBean.getId(), "network-partition-3"); + + PartitionBean p2 = updatedBean.getPartitions().get(1); + assertEquals(updatedBean.getId(), "network-partition-network-partition-test"); assertEquals(updatedBean.getPartitions().size(), 2); - assertEquals(updatedBean.getPartitions().get(1).getId(), "partition-2"); - assertEquals(updatedBean.getPartitions().get(1).getProperty().get(0).getName(), "region"); - assertEquals(updatedBean.getPartitions().get(1).getProperty().get(0).getValue(), "default1"); - assertEquals(updatedBean.getPartitions().get(1).getProperty().get(1).getName(), "zone"); - assertEquals(updatedBean.getPartitions().get(1).getProperty().get(1).getValue(), "z1"); + assertEquals(p2.getId(), "partition-2"); + assertEquals(p2.getProperty().get(0).getName(), "region"); + assertEquals(p2.getProperty().get(0).getValue(), "default1"); + assertEquals(p2.getProperty().get(1).getName(), "zone"); + assertEquals(p2.getProperty().get(1).getValue(), "z1"); boolean removed = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME); @@ -83,7 +88,7 @@ public class NetworkPartitionTest extends StratosTestServerManager { NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(beanRemoved, null); - log.info("Ended network partition test case**************************************"); + log.info("-------------------------Ended network partition test case-------------------------"); } catch (Exception e) { log.error("An error occurred while handling network partitions", e); assertTrue("An error occurred while handling network partitions", false); http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java index 54b04a8..34a9d75 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java @@ -60,8 +60,8 @@ public class RestClient { public RestClient(String endPoint, String userName, String password) { this(); this.endPoint = endPoint; - this.setUserName(userName); - this.setPassword(password); + this.userName = userName; + this.password = password; } /** @@ -352,22 +352,6 @@ public class RestClient { * @return username:password */ private String getUsernamePassword() { - return this.getUserName() + ":" + this.getPassword(); - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; + return this.userName + ":" + this.password; } } http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/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 deleted file mode 100644 index a461844..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/application-policies/application-policy-3.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "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/6c6f4cc3/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 index 4e00d60..c091ec5 100644 --- 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 @@ -1,22 +1,22 @@ { - "applicationId": "cartridge-group-app", + "applicationId": "application-bursting-test", "alias": "my-cartridge-group-app", "components": { "groups": [ { - "name": "esb-php-group", - "alias": "my-esb-php-group", - "deploymentPolicy": "deployment-policy-4", + "name": "esb-php-group-application-bursting-test", + "alias": "my-esb-php-group-application-bursting-test", + "deploymentPolicy": "deployment-policy-application-bursting-test", "groupMinInstances": 1, "groupMaxInstances": 2, "cartridges": [ { - "type": "esb", + "type": "esb-application-bursting-test", "cartridgeMin": 1, "cartridgeMax": 2, "subscribableInfo": { - "alias": "my-esb", - "autoscalingPolicy": "autoscaling-policy-2", + "alias": "my-esb-application-bursting-test", + "autoscalingPolicy": "autoscaling-policy-application-bursting-test", "artifactRepository": { "privateRepo": false, "repoUrl": "https://github.com/imesh/stratos-esb-applications.git", @@ -26,13 +26,13 @@ } }, { - "type": "php", + "type": "php-application-bursting-test", "cartridgeMin": 2, "cartridgeMax": 4, "lvsVirtualIP": "192.168.56.50|255.255.255.0", "subscribableInfo": { - "alias": "my-php", - "autoscalingPolicy": "autoscaling-policy-2", + "alias": "my-php-application-bursting-test", + "autoscalingPolicy": "autoscaling-policy-application-bursting-test", "artifactRepository": { "privateRepo": false, "repoUrl": "https://github.com/imesh/stratos-php-applications.git", @@ -46,13 +46,13 @@ ], "cartridges": [ { - "type": "tomcat", + "type": "tomcat-application-bursting-test", "cartridgeMin": 2, "cartridgeMax": 4, "subscribableInfo": { - "alias": "my-tomcat", - "autoscalingPolicy": "autoscaling-policy-2", - "deploymentPolicy": "deployment-policy-4", + "alias": "my-tomcat-application-bursting-test", + "autoscalingPolicy": "autoscaling-policy-application-bursting-test", + "deploymentPolicy": "deployment-policy-application-bursting-test", "artifactRepository": { "privateRepo": false, "repoUrl": "https://github.com/imesh/stratos-tomcat-applications.git", http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/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 deleted file mode 100644 index 944aa82..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/autoscaling-policies/autoscaling-policy-2.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "autoscaling-policy-2", - "loadThresholds": { - "requestsInFlight": { - "threshold": 35 - }, - "memoryConsumption": { - "threshold": 45 - }, - "loadAverage": { - "threshold": 25 - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/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 deleted file mode 100644 index 008c735..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges-groups/esb-php-group.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100755 index 571e7e1..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/esb.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100755 index 5d53e3a..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/php.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100755 index 395687d..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/cartridges/mock/tomcat.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100644 index f9935d7..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/deployment-policies/deployment-policy-4.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100644 index 1e1ec23..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-10.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100644 index 9f12343..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-bursting-test/network-partitions/mock/network-partition-9.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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/6c6f4cc3/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 deleted file mode 100644 index 1137942..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-policy-test/application-policies/application-policy-2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "application-policy-2", - "algorithm": "one-after-another", - "networkPartitions": [ - "network-partition-7", - "network-partition-8" - ], - "properties": [ - { - "name": "networkPartitionGroups", - "value": "network-partition-7,network-partition-8" - }, - { - "name": "key-2", - "value": "value-2" - } - ] -} http://git-wip-us.apache.org/repos/asf/stratos/blob/6c6f4cc3/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 deleted file mode 100644 index 6250504..0000000 --- a/products/stratos/modules/integration/src/test/resources/application-policy-test/network-partitions/mock/network-partition-7.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": "network-partition-7", - "provider": "mock", - "partitions": [ - { - "id": "partition-1", - "property": [ - { - "name": "region", - "value": "default" - } - ] - } - ] -}
