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/17 09:51:15 UTC
stratos git commit: Update the integration test with tenant operations
Repository: stratos
Updated Branches:
refs/heads/tenant-isolation eea557e58 -> 867cb6ae3
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/867cb6ae
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/867cb6ae
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/867cb6ae
Branch: refs/heads/tenant-isolation
Commit: 867cb6ae3f1fcf74388b2c8ba12e16f3404b55fa
Parents: eea557e
Author: Gayan Gunarathne <ga...@wso2.com>
Authored: Mon Aug 17 10:47:58 2015 +0530
Committer: Gayan Gunarathne <ga...@wso2.com>
Committed: Mon Aug 17 10:47:58 2015 +0530
----------------------------------------------------------------------
.../stratos/integration/tests/group/CartridgeGroupTest.java | 6 ++++++
.../integration/tests/policies/ApplicationPolicyTest.java | 6 ++++++
.../integration/tests/policies/AutoscalingPolicyTest.java | 6 ++++++
.../integration/tests/policies/DeploymentPolicyTest.java | 6 ++++++
.../integration/tests/policies/NetworkPartitionTest.java | 6 ++++++
5 files changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/867cb6ae/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 f2705b9..9b6eefe 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
@@ -72,6 +72,12 @@ public class CartridgeGroupTest extends StratosTestServerManager {
assertEquals(String.format("Cartridge Group name did not match: [cartridge-group-name] %s",
"g4-g5-g6-cartridge-group-test.json"), bean.getName(), "G4-cartridge-group-test");
+ CartridgeGroupBean tenant2Bean = (CartridgeGroupBean) restClientTenant2.
+ getEntity(RestConstants.CARTRIDGE_GROUPS, "G4-cartridge-group-test",
+ CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME);
+ assertNull(String.format("Cartridge Group name fouund in tenant 2: [cartridge-group-name] %s",
+ bean.getName()),tenant2Bean);
+
boolean updated = restClientTenant1.updateEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH +
"/" + "g4-g5-g6-cartridge-group-test-v1.json",
RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME);
http://git-wip-us.apache.org/repos/asf/stratos/blob/867cb6ae/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 49952aa..5c05725 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
@@ -29,6 +29,7 @@ import org.apache.stratos.integration.tests.StratosTestServerManager;
import org.testng.annotations.Test;
import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
/**
@@ -91,6 +92,11 @@ public class ApplicationPolicyTest extends StratosTestServerManager {
applicationPolicyId), false);
}
+ bean = (ApplicationPolicyBean) restClientTenant2.
+ getEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId,
+ ApplicationPolicyBean.class, RestConstants.APPLICATION_POLICIES_NAME);
+ assertNull("Application policy bean found in tenant 2",bean);
+
boolean removedNet = restClientTenant1.removeEntity(RestConstants.NETWORK_PARTITIONS,
"network-partition-application-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
//Trying to remove the used network partition
http://git-wip-us.apache.org/repos/asf/stratos/blob/867cb6ae/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 c1755c4..8064156 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
@@ -26,6 +26,7 @@ import org.apache.stratos.integration.tests.StratosTestServerManager;
import org.testng.annotations.Test;
import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
/**
@@ -72,6 +73,11 @@ public class AutoscalingPolicyTest extends StratosTestServerManager {
assertEquals(String.format("[autoscaling-policy-id] %s Memory is not correct", policyId),
updatedBean.getLoadThresholds().getLoadAverage().getThreshold(), 20.0, 0.0);
+ updatedBean = (AutoscalePolicyBean) restClientTenant2.getEntity(
+ RestConstants.AUTOSCALING_POLICIES, policyId,
+ AutoscalePolicyBean.class, RestConstants.AUTOSCALING_POLICIES_NAME);
+ assertNull("Auto scaling policy found in tenant 2",updatedBean);
+
boolean removed = restClientTenant1.removeEntity(RestConstants.AUTOSCALING_POLICIES,
policyId, RestConstants.AUTOSCALING_POLICIES_NAME);
assertEquals(String.format("[autoscaling-policy-id] %s couldn't be removed", policyId),
http://git-wip-us.apache.org/repos/asf/stratos/blob/867cb6ae/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 3a47e75..7452dca 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
@@ -30,6 +30,7 @@ import org.apache.stratos.integration.tests.StratosTestServerManager;
import org.testng.annotations.Test;
import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
/**
@@ -132,6 +133,11 @@ public class DeploymentPolicyTest extends StratosTestServerManager {
"network-partition-6-partition-2");
assertEquals(nw2P2.getPartitionMax(), 5);
+ updatedBean = (DeploymentPolicyBean) restClientTenant2.
+ getEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId,
+ DeploymentPolicyBean.class, RestConstants.DEPLOYMENT_POLICIES_NAME);
+ assertNull("Deployment policy found in tenant 2",updatedBean);
+
boolean removedNet = restClientTenant1.removeEntity(RestConstants.NETWORK_PARTITIONS,
"network-partition-deployment-policy-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
//Trying to remove the used network partition
http://git-wip-us.apache.org/repos/asf/stratos/blob/867cb6ae/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 2f6b2e5..a0fa583 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
@@ -28,6 +28,7 @@ import org.apache.stratos.integration.tests.StratosTestServerManager;
import org.testng.annotations.Test;
import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
/**
@@ -78,6 +79,11 @@ public class NetworkPartitionTest extends StratosTestServerManager {
assertEquals(p2.getProperty().get(1).getName(), "zone");
assertEquals(p2.getProperty().get(1).getValue(), "z1");
+ updatedBean = (NetworkPartitionBean) restClientTenant2.
+ getEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId,
+ NetworkPartitionBean.class, RestConstants.NETWORK_PARTITIONS_NAME);
+ assertNull("Network partition found in tenant 2",updatedBean);
+
boolean removed = restClientTenant1.removeEntity(RestConstants.NETWORK_PARTITIONS,
networkPartitionId, RestConstants.NETWORK_PARTITIONS_NAME);
assertEquals(removed, true);