Repository: stratos Updated Branches: refs/heads/tenant-isolation 867cb6ae3 -> f7cd51769
Update the integration test with tenant operations Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/f7cd5176 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/f7cd5176 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/f7cd5176 Branch: refs/heads/tenant-isolation Commit: f7cd51769ffab6ddb21b6522986c675822b4703a Parents: 867cb6a Author: gayangunarathne <[email protected]> Authored: Mon Aug 17 15:50:06 2015 +0530 Committer: gayangunarathne <[email protected]> Committed: Mon Aug 17 15:50:06 2015 +0530 ---------------------------------------------------------------------- .../stratos/integration/tests/TopologyHandler.java | 2 +- .../application/PartitionRoundRobinClusterTest.java | 6 +++--- .../tests/application/SampleApplicationsTest.java | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/f7cd5176/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java index 554bb04..c631461 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/TopologyHandler.java @@ -58,7 +58,7 @@ import static junit.framework.Assert.*; public class TopologyHandler { private static final Log log = LogFactory.getLog(TopologyHandler.class); - public static final int APPLICATION_ACTIVATION_TIMEOUT = 300000; + public static final int APPLICATION_ACTIVATION_TIMEOUT = 400000; public static final int APPLICATION_UNDEPLOYMENT_TIMEOUT = 60000; public static final int APPLICATION_TOPOLOGY_TIMEOUT = 60000; public static final String APPLICATION_STATUS_CREATED = "Created"; http://git-wip-us.apache.org/repos/asf/stratos/blob/f7cd5176/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java index c09aba7..7f4bd23 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java @@ -109,14 +109,14 @@ public class PartitionRoundRobinClusterTest extends StratosTestServerManager { log.info("Waiting for the faulty member detection from " + "CEP as the statistics are stopped..."); TopologyHandler.getInstance().assertApplicationStatus(bean.getApplicationId(), - ApplicationStatus.Inactive,-1234); + ApplicationStatus.Inactive,tenant1Id); */ //Application active handling after application becomes active again TopologyHandler.getInstance().assertApplicationStatus(bean.getApplicationId(), - ApplicationStatus.Active,-1234); + ApplicationStatus.Active,tenant1Id); //Cluster active handling - TopologyHandler.getInstance().assertClusterActivation(bean.getApplicationId(),-1234); */ + TopologyHandler.getInstance().assertClusterActivation(bean.getApplicationId(),tenant1Id); boolean removedAuto = restClientTenant1.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); http://git-wip-us.apache.org/repos/asf/stratos/blob/f7cd5176/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java index 95b296e..dea1f8a 100644 --- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java +++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java @@ -29,9 +29,7 @@ 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.assertFalse; -import static junit.framework.Assert.assertTrue; +import static junit.framework.Assert.*; /** * Sample application tests with application add, . @@ -131,6 +129,11 @@ public class SampleApplicationsTest extends StratosTestServerManager { assertEquals(c3.getCartridgeMin(), 1); assertEquals(c3.getCartridgeMax(), 2); + bean = (ApplicationBean) restClientTenant2.getEntity(RestConstants.APPLICATIONS, + "g-sc-G123-1-sample-applications-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + + assertNull("Application found in tenant 2",bean); + boolean updated = restClientTenant1.updateEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/g-sc-G123-1-sample-applications-test-v1.json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); @@ -139,7 +142,7 @@ public class SampleApplicationsTest extends StratosTestServerManager { ApplicationBean updatedBean = (ApplicationBean) restClientTenant1.getEntity(RestConstants.APPLICATIONS, "g-sc-G123-1-sample-applications-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); - assertEquals(bean.getApplicationId(), "g-sc-G123-1-sample-applications-test"); + assertEquals(updatedBean.getApplicationId(), "g-sc-G123-1-sample-applications-test"); group1 = updatedBean.getComponents().getGroups().get(0); group2 = group1.getGroups().get(0); @@ -175,6 +178,10 @@ public class SampleApplicationsTest extends StratosTestServerManager { assertEquals(c3.getCartridgeMin(), 2); assertEquals(c3.getCartridgeMax(), 3); + updatedBean = (ApplicationBean) restClientTenant2.getEntity(RestConstants.APPLICATIONS, + "g-sc-G123-1-sample-applications-test", ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + + assertNull("Application found in tenant 2",updatedBean); boolean removedGroup = restClientTenant1.removeEntity(RestConstants.CARTRIDGE_GROUPS, "G1-sample-applications-test", RestConstants.CARTRIDGE_GROUPS_NAME);
