You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/09/13 22:04:26 UTC

[1/2] stratos git commit: Grouping integration tests, adding smoke test suite

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x d1d8d0b62 -> 973c05b57


Grouping integration tests, adding smoke test suite


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/644803fd
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/644803fd
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/644803fd

Branch: refs/heads/stratos-4.1.x
Commit: 644803fdd7c2d4ee40aca74dbd33ba5da03ae55e
Parents: d1d8d0b
Author: Akila Perera <ra...@gmail.com>
Authored: Sat Sep 12 00:07:43 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Sat Sep 12 00:07:43 2015 +0530

----------------------------------------------------------------------
 .../common/StratosTestServerManager.java        |   1 -
 .../integration/test-integration/pom.xml        |   5 +-
 .../application/ApplicationBurstingTest.java    |   2 +-
 .../application/ApplicationUpdateTest.java      |   2 +-
 .../application/GroupStartupOrderTest.java      |   2 +-
 .../GroupTerminationBehaviorTest.java           |   2 +-
 .../PartitionOneAfterAnotherClusterTest.java    |   2 +-
 .../PartitionRoundRobinClusterTest.java         |   2 +-
 .../application/SampleApplicationsTest.java     |   4 +-
 .../application/SingleClusterScalingTest.java   |   2 +-
 .../tests/group/CartridgeGroupTest.java         |   4 +-
 .../integration/tests/group/CartridgeTest.java  |   4 +-
 .../tests/policies/ApplicationPolicyTest.java   |   4 +-
 .../tests/policies/AutoscalingPolicyTest.java   |   4 +-
 .../tests/policies/DeploymentPolicyTest.java    |   4 +-
 .../tests/policies/NetworkPartitionTest.java    |   4 +-
 .../integration/tests/users/TenantTest.java     |   2 +-
 .../integration/tests/users/UserTest.java       |   2 +-
 .../src/test/resources/stratos-testng.xml       | 101 -------------------
 .../src/test/resources/test-suite-all.xml       |  44 ++++++++
 .../src/test/resources/test-suite-smoke.xml     |  45 +++++++++
 21 files changed, 116 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java
index be73c6e..ed233c4 100644
--- a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java
+++ b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/StratosTestServerManager.java
@@ -101,7 +101,6 @@ public class StratosTestServerManager extends TestServerManager {
         this.carbonZip = carbonZip;
     }
 
-    // TODO: get rid of this method once startup script issue is fixed in automation engine
     public String startServer() throws AutomationFrameworkException, IOException, XPathExpressionException {
         if (this.carbonHome == null) {
             if (this.carbonZip == null) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/pom.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/pom.xml b/products/stratos/modules/integration/test-integration/pom.xml
index d27916c..c30ff2a 100755
--- a/products/stratos/modules/integration/test-integration/pom.xml
+++ b/products/stratos/modules/integration/test-integration/pom.xml
@@ -175,7 +175,7 @@
                         <filters.file>${basedir}/src/test/resources/filters.txt</filters.file>
                     </systemProperties>
                     <suiteXmlFiles>
-                        <suiteXmlFile>${basedir}/src/test/resources/stratos-testng.xml</suiteXmlFile>
+                        <suiteXmlFile>${suiteFile}</suiteXmlFile>
                     </suiteXmlFiles>
                     <workingDirectory>${basedir}/target</workingDirectory>
                 </configuration>
@@ -223,4 +223,7 @@
             </plugin>
         </plugins>
     </build>
+    <properties>
+        <suiteFile>${basedir}/src/test/resources/test-suite-all.xml</suiteFile>
+    </properties>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
index fc14469..43e3732 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTest.java
@@ -42,7 +42,7 @@ public class ApplicationBurstingTest extends StratosIntegrationTest {
     private static final String RESOURCES_PATH = "/application-bursting-test";
 
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testApplicationBusting() {
         try {
             log.info("----------------------------Started application Bursting test case----------------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
index 310f644..b07ea2f 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTest.java
@@ -40,7 +40,7 @@ public class ApplicationUpdateTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(ApplicationUpdateTest.class);
     private static final String RESOURCES_PATH = "/application-update-test";
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testDeployApplication() {
         try {
             log.info("-------------------------Started application runtime update test case-------------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTest.java
index b7bff04..031c4ea 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTest.java
@@ -44,7 +44,7 @@ public class GroupStartupOrderTest extends StratosIntegrationTest {
     private static final int NODES_START_PARALLEL_TIMEOUT = 30000;
 
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testTerminationBehavior() {
         try {
             log.info("----------------------Started application startup order test case------------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
index 2134385..262b6eb 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupTerminationBehaviorTest.java
@@ -47,7 +47,7 @@ public class GroupTerminationBehaviorTest extends StratosIntegrationTest {
     private static final String RESOURCES_PATH = "/group-termination-behavior-test";
     private static final int GROUP_INACTIVE_TIMEOUT = 180000;
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment", "failed"})
     public void testTerminationBehavior() {
         try {
             log.info("----------------------Started application termination behavior test case----------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
index ddd157f..76bf716 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionOneAfterAnotherClusterTest.java
@@ -50,7 +50,7 @@ public class PartitionOneAfterAnotherClusterTest extends StratosIntegrationTest
     private static final String RESOURCES_PATH = "/partition-round-robin-cluster-test";
 
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment", "failed"})
     public void testDeployApplication() {
         try {
             log.info("-----------------------Started Partition One after another test case-----------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
index 35fd827..58fb0a3 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/PartitionRoundRobinClusterTest.java
@@ -48,7 +48,7 @@ public class PartitionRoundRobinClusterTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(SampleApplicationsTest.class);
     private static final String RESOURCES_PATH = "/partition-round-robin-cluster-test";
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testDeployApplication() {
         try {
             log.info("------------------------Started application Bursting test case-----------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
index b8653af..f2120cf 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationsTest.java
@@ -45,7 +45,7 @@ public class SampleApplicationsTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(SampleApplicationsTest.class);
     private static final String RESOURCES_PATH = "/sample-applications-test";
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testApplication() {
         log.info("-------------------------------Started application test case-------------------------------");
         try {
@@ -252,7 +252,7 @@ public class SampleApplicationsTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testApplicationList() {
         log.info("-------------------------------Started application listtest case-------------------------------");
         try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
index edf8c0c..71702f1 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SingleClusterScalingTest.java
@@ -53,7 +53,7 @@ public class SingleClusterScalingTest extends StratosIntegrationTest {
     private static final int CLUSTER_SCALE_DOWN_TIMEOUT = 360000;
     private int activeInstancesAfterScaleup = 0;
 
-    @Test(timeOut = APPLICATION_TEST_TIMEOUT)
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"})
     public void testDeployApplication() {
         try {
             log.info("------------------------Started application Bursting test case----------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
index 0b0a9d1..cf4e995 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeGroupTest.java
@@ -42,7 +42,7 @@ public class CartridgeGroupTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(CartridgeGroupTest.class);
     private static final String RESOURCES_PATH = "/cartridge-group-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.cartridge.deployment", "smoke"})
     public void testCartridgeGroup() {
         try {
             log.info("-------------------------Started Cartridge group test case-------------------------");
@@ -144,7 +144,7 @@ public class CartridgeGroupTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.cartridge.deployment", "smoke"})
     public void testCartridgeGroupList() {
         try {
             log.info("-------------------------Started Cartridge group list test case-------------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
index 5c3db3d..1e72dc5 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/group/CartridgeTest.java
@@ -44,7 +44,7 @@ public class CartridgeTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(CartridgeTest.class);
     private static final String RESOURCES_PATH = "/cartridge-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.cartridge.deployment", "smoke"})
     public void testCartridge() {
         log.info("--------------------Started Cartridge test case-----------------------------");
 
@@ -135,7 +135,7 @@ public class CartridgeTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.cartridge.deployment", "smoke"})
     public void testCartridgeList() {
         log.info("--------------------Started Cartridge list test case-----------------------------");
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
index 08d2a7a..5df6f4f 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/ApplicationPolicyTest.java
@@ -44,7 +44,7 @@ public class ApplicationPolicyTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(ApplicationPolicyTest.class);
     private static final String RESOURCES_PATH = "/application-policy-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testApplicationPolicy() {
         try {
             String applicationPolicyId = "application-policy-application-policy-test";
@@ -140,7 +140,7 @@ public class ApplicationPolicyTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testApplicationPolicyList() {
         try {
             String applicationPolicyId1 = "application-policy-application-policy-test-1";

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
index 70c3a78..476e993 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/AutoscalingPolicyTest.java
@@ -39,7 +39,7 @@ public class AutoscalingPolicyTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(AutoscalingPolicyTest.class);
     private static final String RESOURCES_PATH = "/autoscaling-policy-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testAutoscalingPolicy() {
         log.info("-------------------------Started autoscaling policy test case-------------------------");
         String policyId = "autoscaling-policy-autoscaling-policy-test";
@@ -95,7 +95,7 @@ public class AutoscalingPolicyTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testAutoscalingPolicyList() {
         log.info("-------------------------Started autoscaling policy list test case-------------------------");
         String policyId1 = "autoscaling-policy-autoscaling-policy-test-1";

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
index c0f237b..3a3169a 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/DeploymentPolicyTest.java
@@ -46,7 +46,7 @@ public class DeploymentPolicyTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(DeploymentPolicyTest.class);
     private static final String RESOURCES_PATH = "/deployment-policy-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testDeploymentPolicy() {
         try {
             String deploymentPolicyId = "deployment-policy-deployment-policy-test";
@@ -179,7 +179,7 @@ public class DeploymentPolicyTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testDeploymentPolicyList() {
         try {
             String deploymentPolicyId1 = "deployment-policy-deployment-policy-test-1";

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
index ec335a9..04c3a38 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/policies/NetworkPartitionTest.java
@@ -44,7 +44,7 @@ public class NetworkPartitionTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(NetworkPartitionTest.class);
     private static final String RESOURCES_PATH = "/network-partition-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testNetworkPartition() {
         try {
             String networkPartitionId = "network-partition-network-partition-test";
@@ -100,7 +100,7 @@ public class NetworkPartitionTest extends StratosIntegrationTest {
         }
     }
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"stratos.policy.management", "smoke"})
     public void testNetworkPartitionList() {
         try {
             String networkPartitionId1 = "network-partition-network-partition-test-1";

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
index 876af01..9cab5e7 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
@@ -31,7 +31,7 @@ import static junit.framework.Assert.assertTrue;
 public class TenantTest extends StratosIntegrationTest {
     private static final String RESOURCES_PATH = "/user-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"user.management", "smoke", "disabled"})
     public void addUser() {
         String tenantId = "tenant-1";
         boolean addedUser1 = restClient.addEntity(RESOURCES_PATH + "/" +

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
index 9f64e4b..3e760d8 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
@@ -39,7 +39,7 @@ public class UserTest extends StratosIntegrationTest {
     private static final Log log = LogFactory.getLog(UserTest.class);
     private static final String RESOURCES_PATH = "/user-test";
 
-    @Test(timeOut = GLOBAL_TEST_TIMEOUT)
+    @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"user.management", "smoke"})
     public void addUser() {
         try {
             log.info("-------------------------------Started users test case-------------------------------");

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/resources/stratos-testng.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/stratos-testng.xml b/products/stratos/modules/integration/test-integration/src/test/resources/stratos-testng.xml
deleted file mode 100644
index 040bde0..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/stratos-testng.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-
-<suite name="StratosIntegrationSuite">
-    <listeners>
-        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
-        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestSuiteListener"/>
-        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
-        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestManagerListener"/>
-        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestReportListener"/>
-    </listeners>
-    <test name="UserTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.users.UserTest"/>
-        </classes>
-    </test>
-    <test name="CartridgeTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.group.CartridgeTest"/>
-        </classes>
-    </test>
-    <test name="CartridgeGroupTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest"/>
-        </classes>
-    </test>
-    <test name="NetworkPartitionTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest"/>
-        </classes>
-    </test>
-    <test name="ApplicationPolicyTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest"/>
-        </classes>
-    </test>
-    <test name="DeploymentPolicyTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest"/>
-        </classes>
-    </test>
-    <test name="AutoscalingPolicyTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest"/>
-        </classes>
-    </test>
-    <test name="SampleApplicationsTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest"/>
-        </classes>
-    </test>
-    <test name="ApplicationUpdateTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest"/>
-        </classes>
-    </test>
-    <test name="SingleClusterScalingTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest"/>
-        </classes>
-    </test>
-    <test name="ApplicationBurstingTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest"/>
-        </classes>
-    </test>
-    <test name="PartitionRoundRobinClusterTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest"/>
-        </classes>
-    </test>
-    <test name="GroupStartupOrderTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest"/>
-        </classes>
-    </test>
-    <!--test name="GroupTerminationBehaviorTest" preserve-order="true" parallel="false">
-        <classes>
-            <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest"/>
-        </classes>
-    </test-->
-</suite>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-all.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-all.xml b/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-all.xml
new file mode 100644
index 0000000..be687f2
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-all.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="StratosIntegrationSuite">
+    <listeners>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestSuiteListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestManagerListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestReportListener"/>
+    </listeners>
+
+    <test name="all" preserve-order="true" parallel="false">
+        <groups>
+            <run>
+                <exclude name="failed"/>
+                <exclude name="disabled"/>
+            </run>
+        </groups>
+
+        <packages>
+            <package name="org.apache.stratos.integration.tests.*"/>
+        </packages>
+    </test>
+</suite>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/644803fd/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-smoke.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-smoke.xml b/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-smoke.xml
new file mode 100644
index 0000000..bc44369
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/test-suite-smoke.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<suite name="StratosIntegrationSuite">
+    <listeners>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestExecutionListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestSuiteListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestTransformerListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestManagerListener"/>
+        <listener class-name="org.wso2.carbon.automation.engine.testlisteners.TestReportListener"/>
+    </listeners>
+
+    <test name="smoke" preserve-order="true" parallel="false">
+        <groups>
+            <run>
+                <include name="smoke"/>
+                <exclude name="failed"/>
+                <exclude name="disabled"/>
+            </run>
+        </groups>
+
+        <packages>
+            <package name="org.apache.stratos.integration.tests.*"/>
+        </packages>
+    </test>
+</suite>
\ No newline at end of file


[2/2] stratos git commit: Adding smoke test suite, adding SampleApplicationStartupTestCase to cover basic functionality

Posted by ra...@apache.org.
Adding smoke test suite, adding SampleApplicationStartupTestCase to cover basic functionality


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/973c05b5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/973c05b5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/973c05b5

Branch: refs/heads/stratos-4.1.x
Commit: 973c05b5738b2c4d3f41d9bdbe23f43972a5401f
Parents: 644803f
Author: Akila Perera <ra...@gmail.com>
Authored: Mon Sep 14 01:33:30 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Mon Sep 14 01:33:30 2015 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.rest.endpoint/pom.xml    |   1 +
 .../integration/common/rest/RestClient.java     |  77 +++++---
 .../test-integration/run-smoke-test.sh          |  24 +++
 .../SampleApplicationStartupTestCase.java       | 196 +++++++++++++++++++
 ...ication-policy-sample-applications-test.json |  17 ++
 .../sample-applications-test-1.json             |  24 +++
 ...scaling-policy-sample-applications-test.json |  14 ++
 .../mock/c1-sample-applications-test.json       |  45 +++++
 ...loyment-policy-sample-applications-test.json |  18 ++
 ...rk-partition-sample-applications-test-1.json |  15 ++
 10 files changed, 401 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/components/org.apache.stratos.rest.endpoint/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/pom.xml b/components/org.apache.stratos.rest.endpoint/pom.xml
index c671254..016a95c 100644
--- a/components/org.apache.stratos.rest.endpoint/pom.xml
+++ b/components/org.apache.stratos.rest.endpoint/pom.xml
@@ -69,6 +69,7 @@
                         </resource>
                     </webResources>
                     <warName>api</warName>
+                    <attachClasses>true</attachClasses>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/rest/RestClient.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/rest/RestClient.java b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/rest/RestClient.java
index 50783fa..f1beec7 100644
--- a/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/rest/RestClient.java
+++ b/products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/rest/RestClient.java
@@ -80,11 +80,13 @@ public class RestClient {
             postRequest.setEntity(input);
 
             String userPass = getUsernamePassword();
-            String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
+            String basicAuth =
+                    "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
             postRequest.addHeader("Authorization", basicAuth);
 
             return httpClient.execute(postRequest, new HttpResponseHandler());
-        } finally {
+        }
+        finally {
             releaseConnection(postRequest);
         }
     }
@@ -103,11 +105,13 @@ public class RestClient {
             getRequest = new HttpGet(resourcePath);
             getRequest.addHeader("Content-Type", "application/json");
             String userPass = getUsernamePassword();
-            String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
+            String basicAuth =
+                    "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
             getRequest.addHeader("Authorization", basicAuth);
 
             return httpClient.execute(getRequest, new HttpResponseHandler());
-        } finally {
+        }
+        finally {
             releaseConnection(getRequest);
         }
     }
@@ -118,10 +122,12 @@ public class RestClient {
             httpDelete = new HttpDelete(resourcePath);
             httpDelete.addHeader("Content-Type", "application/json");
             String userPass = getUsernamePassword();
-            String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
+            String basicAuth =
+                    "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
             httpDelete.addHeader("Authorization", basicAuth);
             return httpClient.execute(httpDelete, new HttpResponseHandler());
-        } finally {
+        }
+        finally {
             releaseConnection(httpDelete);
         }
     }
@@ -136,10 +142,12 @@ public class RestClient {
             input.setContentType("application/json");
             putRequest.setEntity(input);
             String userPass = getUsernamePassword();
-            String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
+            String basicAuth =
+                    "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userPass.getBytes("UTF-8"));
             putRequest.addHeader("Authorization", basicAuth);
             return httpClient.execute(putRequest, new HttpResponseHandler());
-        } finally {
+        }
+        finally {
             releaseConnection(putRequest);
         }
     }
@@ -171,7 +179,8 @@ public class RestClient {
             String msg = "An unknown error occurred while trying to add ";
             log.error(msg + entityName);
             throw new RuntimeException(msg + entityName);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not add " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -198,7 +207,8 @@ public class RestClient {
             String msg = "An unknown error occurred while trying to deploy ";
             log.error(msg + entityName);
             throw new RuntimeException(msg + entityName);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not deploy  " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -225,7 +235,8 @@ public class RestClient {
             String msg = "An unknown error occurred while trying to undeploy ";
             log.error(msg + entityName);
             throw new RuntimeException(msg + entityName);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not deploy  " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -255,7 +266,8 @@ public class RestClient {
             String msg = "An unknown error occurred while getting the " + entityName;
             log.error(msg);
             throw new RuntimeException(msg);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not get " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);
@@ -284,21 +296,30 @@ public class RestClient {
             String msg = "An unknown error occurred while getting the " + entityName;
             log.error(msg);
             throw new RuntimeException(msg);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not get " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);
         }
     }
 
-    public boolean removeEntity(String resourcePath, String identifier, String entityName) {
-        try {
-            URI uri = new URIBuilder(this.endPoint + "/" + resourcePath + "/" + identifier).build();
-            HttpResponse response = doDelete(uri);
-            if (response != null) {
-                if ((response.getStatusCode() >= 200) && (response.getStatusCode() < 300)) {
-                    return true;
-                } else if (response.getContent().contains("it is used") || response.getContent().contains("in use")) {
+    public boolean removeEntity(String resourcePath, String identifier, String entityName) throws Exception {
+
+        URI uri = new URIBuilder(this.endPoint + "/" + resourcePath + "/" + identifier).build();
+        HttpResponse response = doDelete(uri);
+        if (response != null) {
+            if ((response.getStatusCode() >= 200) && (response.getStatusCode() < 300)) {
+                return true;
+            } else {
+                GsonBuilder gsonBuilder = new GsonBuilder();
+                Gson gson = gsonBuilder.create();
+                ErrorResponse errorResponse = gson.fromJson(response.getContent(),
+                        ErrorResponse.class);
+                log.error("Error response while removing entity [identifier] " + identifier + ", [entity name] " +
+                        entityName + ", [error] " + errorResponse.getErrorMessage() + ", [error code] " + errorResponse
+                        .getErrorCode());
+                /*else if (response.getContent().contains("it is used") || response.getContent().contains("in use")) {
                     return false;
                 } else {
                     GsonBuilder gsonBuilder = new GsonBuilder();
@@ -308,16 +329,11 @@ public class RestClient {
                     if (errorResponse != null) {
                         throw new RuntimeException(errorResponse.getErrorMessage());
                     }
-                }
+                }*/
+                return false;
             }
-            String msg = "An unknown error occurred while removing the " + entityName;
-            log.error(msg);
-            throw new RuntimeException(msg);
-        } catch (Exception e) {
-            String message = "Could not remove  " + entityName;
-            log.error(message, e);
-            throw new RuntimeException(message, e);
         }
+        throw new Exception("No response received from back-end.");
     }
 
     public boolean updateEntity(String filePath, String resourcePath, String entityName) {
@@ -342,7 +358,8 @@ public class RestClient {
             String msg = "An unknown error occurred while trying to update ";
             log.error(msg + entityName);
             throw new RuntimeException(msg + entityName);
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             String message = "Could not update " + entityName;
             log.error(message, e);
             throw new RuntimeException(message, e);

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/run-smoke-test.sh
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/run-smoke-test.sh b/products/stratos/modules/integration/test-integration/run-smoke-test.sh
new file mode 100755
index 0000000..b56e956
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/run-smoke-test.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# --------------------------------------------------------------
+#
+# 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.
+#
+# --------------------------------------------------------------
+#
+set -e
+mvn clean install -DsuiteFile=src/test/resources/test-suite-smoke.xml

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationStartupTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationStartupTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationStartupTestCase.java
new file mode 100644
index 0000000..29405a2
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/SampleApplicationStartupTestCase.java
@@ -0,0 +1,196 @@
+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.policy.deployment.ApplicationPolicyBean;
+import org.apache.stratos.integration.common.RestConstants;
+import org.apache.stratos.integration.common.TopologyHandler;
+import org.apache.stratos.integration.tests.StratosIntegrationTest;
+import org.apache.stratos.messaging.domain.application.ApplicationStatus;
+import org.apache.stratos.messaging.domain.topology.Member;
+import org.testng.annotations.Test;
+
+import java.util.Map;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+/**
+ * Deploy a sample application on mock IaaS and assert whether application instance, cluster instance, member instances
+ * are getting activated. Kill the mock instance and check whether
+ */
+public class SampleApplicationStartupTestCase extends StratosIntegrationTest {
+    private static final Log log = LogFactory.getLog(SampleApplicationsTest.class);
+    private static final String RESOURCES_PATH = "/sample-application-startup-test";
+
+    @Test(timeOut = APPLICATION_TEST_TIMEOUT, description = "Application startup, activation and faulty member " +
+            "detection", groups = {"stratos.application.startup", "smoke"})
+    public void testApplication() throws Exception {
+        String autoscalingPolicyId = "autoscaling-policy-sample-applications-test";
+        TopologyHandler topologyHandler = TopologyHandler.getInstance();
+
+        log.info("Adding autoscaling policy [autoscale policy id] " + autoscalingPolicyId);
+        boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH
+                        + "/" + autoscalingPolicyId + ".json",
+                RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME);
+        assertTrue(addedScalingPolicy);
+
+        log.info("Adding cartridge [cartridge type] c1-sample-applications-test");
+        boolean addedC1 = restClient.addEntity(
+                RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + "c1-sample-applications-test.json",
+                RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME);
+        assertTrue(addedC1);
+
+        log.info("Adding network partition [network partition id] network-partition-sample-applications-test-1");
+        boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" +
+                        "network-partition-sample-applications-test-1.json",
+                RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME);
+        assertTrue(addedN1);
+
+        log.info("Adding deployment policy [deployment policy id] deployment-policy-sample-applications-test");
+        boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" +
+                        "deployment-policy-sample-applications-test.json",
+                RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME);
+        assertTrue(addedDep);
+
+        log.info("Adding application [application id] sample-applications-test-1");
+        boolean addedApp = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" +
+                        "sample-applications-test-1.json", RestConstants.APPLICATIONS,
+                RestConstants.APPLICATIONS_NAME);
+        assertEquals(addedApp, true);
+
+        ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
+                "sample-applications-test-1", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+        assertEquals(bean.getApplicationId(), "sample-applications-test-1");
+
+        log.info("Adding application policy [application policy id] application-policy-sample-applications-test");
+        boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" +
+                        "application-policy-sample-applications-test.json", RestConstants.APPLICATION_POLICIES,
+                RestConstants.APPLICATION_POLICIES_NAME);
+        assertTrue(addAppPolicy);
+
+        ApplicationPolicyBean policyBean = (ApplicationPolicyBean) restClient.getEntity(
+                RestConstants.APPLICATION_POLICIES, "application-policy-sample-applications-test",
+                ApplicationPolicyBean.class, RestConstants.APPLICATION_POLICIES_NAME);
+        assertEquals(policyBean.getId(), "application-policy-sample-applications-test");
+
+        // Used policies/cartridges should not removed...asserting validations when removing policies
+        log.info("Trying to remove the used autoscaling policy...");
+        boolean removedUsedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
+                autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
+        assertFalse(removedUsedAuto);
+
+        log.info("Trying to remove the used network partition...");
+        boolean removedUsedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+                "network-partition-sample-applications-test-1",
+                RestConstants.NETWORK_PARTITIONS_NAME);
+        assertFalse(removedUsedNet);
+
+        log.info("Trying to remove the used deployment policy...");
+        boolean removedUsedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
+                "deployment-policy-sample-applications-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
+        assertFalse(removedUsedDep);
+
+        log.info("Deploying application [application id] sample-applications-test-1 using [application policy id] " +
+                "application-policy-sample-applications-test");
+        String resourcePath = RestConstants.APPLICATIONS + "/sample-applications-test-1" +
+                RestConstants.APPLICATIONS_DEPLOY + "/application-policy-sample-applications-test";
+        boolean deployed = restClient.deployEntity(resourcePath,
+                RestConstants.APPLICATIONS_NAME);
+        assertTrue(deployed);
+
+        log.info("Trying to remove the used application policy");
+        boolean removedUsedAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
+                "application-policy-sample-applications-test", RestConstants.APPLICATION_POLICIES_NAME);
+        assertFalse(removedUsedAppPolicy);
+
+        log.info("Trying to remove the deployed application without undeploying first");
+        boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, "sample-applications-test-1",
+                RestConstants.APPLICATIONS_NAME);
+        assertFalse(removed);
+
+        log.info("Waiting for application status to become ACTIVE...");
+        topologyHandler.assertApplicationStatus(bean.getApplicationId(), ApplicationStatus.Active);
+
+        log.info("Waiting for cluster status to become ACTIVE...");
+        topologyHandler.assertClusterActivation(bean.getApplicationId());
+
+        log.info("Terminating members in [cluster id] c1-sample-applications-test in mock IaaS directly to simulate " +
+                "faulty members...");
+        Map<String, Member> memberMap = TopologyHandler.getInstance().getMembersForCluster
+                ("c1-sample-applications-test", bean.getApplicationId());
+        for (Map.Entry<String, Member> entry : memberMap.entrySet()) {
+            String memberId = entry.getValue().getMemberId();
+            TopologyHandler.getInstance().terminateMemberInMockIaas(memberId, mockIaasApiClient);
+            TopologyHandler.getInstance().assertMemberTermination(memberId);
+        }
+        // application status should be marked as inactive since some members are faulty
+        log.info("Waiting for application status to become INACTIVE");
+        topologyHandler.assertApplicationStatus(bean.getApplicationId(), ApplicationStatus.Inactive);
+
+        // application should recover itself and become active after spinning more instances
+        log.info("Waiting for application status to become ACTIVE...");
+        topologyHandler.assertApplicationStatus(bean.getApplicationId(), ApplicationStatus.Active);
+
+        log.info("Waiting for cluster status to become ACTIVE...");
+        topologyHandler.assertClusterActivation(bean.getApplicationId());
+
+        log.info("Un-deploying the application [application id] sample-applications-test-1");
+        String resourcePathUndeploy = RestConstants.APPLICATIONS + "/sample-applications-test-1" +
+                RestConstants.APPLICATIONS_UNDEPLOY;
+
+        boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy,
+                RestConstants.APPLICATIONS_NAME);
+        assertTrue(unDeployed);
+
+        boolean undeploy = topologyHandler.assertApplicationUndeploy("sample-applications-test-1");
+        if (!undeploy) {
+            //Need to forcefully undeploy the application
+            log.info("Force undeployment is going to start for the [application] sample-applications-test-1");
+
+            restClient.undeployEntity(RestConstants.APPLICATIONS + "/sample-applications-test-1" +
+                    RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS);
+
+            boolean forceUndeployed = topologyHandler.assertApplicationUndeploy("sample-applications-test-1");
+            assertTrue(String.format("Forceful undeployment failed for the application %s",
+                    "sample-applications-test-1"), forceUndeployed);
+        }
+
+        log.info("Removing the application [application id] sample-applications-test-1");
+        boolean removedApp = restClient.removeEntity(RestConstants.APPLICATIONS, "sample-applications-test-1",
+                RestConstants.APPLICATIONS_NAME);
+        assertTrue(removedApp);
+
+        ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS,
+                "sample-applications-test-1", ApplicationBean.class, RestConstants.APPLICATIONS_NAME);
+        assertNull(beanRemoved);
+
+        log.info("Removing the application policy [application policy id] application-policy-sample-applications-test");
+        boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES,
+                "application-policy-sample-applications-test", RestConstants.APPLICATION_POLICIES_NAME);
+        assertTrue(removeAppPolicy);
+
+        log.info("Removing the cartridge [cartridge type] c1-sample-applications-test");
+        boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, "c1-sample-applications-test",
+                RestConstants.CARTRIDGES_NAME);
+        assertTrue(removedC1);
+
+        log.info("Removing the autoscaling policy [autoscaling policy id] " + autoscalingPolicyId);
+        boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES,
+                autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME);
+        assertTrue(removedAuto);
+
+        log.info("Removing the deployment policy [deployment policy id] deployment-policy-sample-applications-test");
+        boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES,
+                "deployment-policy-sample-applications-test", RestConstants.DEPLOYMENT_POLICIES_NAME);
+        assertTrue(removedDep);
+
+        log.info("Removing the network partition [network partition id] network-partition-sample-applications-test-1");
+        boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS,
+                "network-partition-sample-applications-test-1", RestConstants.NETWORK_PARTITIONS_NAME);
+        assertTrue(removedNet);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/application-policies/application-policy-sample-applications-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/application-policies/application-policy-sample-applications-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/application-policies/application-policy-sample-applications-test.json
new file mode 100644
index 0000000..df1ffb9
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/application-policies/application-policy-sample-applications-test.json
@@ -0,0 +1,17 @@
+{
+    "id": "application-policy-sample-applications-test",
+    "algorithm": "one-after-another",
+    "networkPartitions": [
+        "network-partition-sample-applications-test-1"
+    ],
+    "properties": [
+        {
+            "name": "networkPartitionGroups",
+            "value": "network-partition-sample-applications-test-1"
+        },
+        {
+            "name": "key-2",
+            "value": "value-2"
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/applications/sample-applications-test-1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/applications/sample-applications-test-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/applications/sample-applications-test-1.json
new file mode 100644
index 0000000..ce02f6c
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/applications/sample-applications-test-1.json
@@ -0,0 +1,24 @@
+{
+    "alias": "sample-applications-test-1",
+    "applicationId": "sample-applications-test-1",
+    "components": {
+      "cartridges": [
+        {
+          "type": "c1-sample-applications-test",
+          "cartridgeMin": 3,
+          "cartridgeMax": 5,
+          "subscribableInfo": {
+            "alias": "c1-1x0-sample-applications-test",
+            "autoscalingPolicy": "autoscaling-policy-sample-applications-test",
+            "deploymentPolicy": "deployment-policy-sample-applications-test",
+            "artifactRepository": {
+              "privateRepo": false,
+              "repoUrl": "https://github.com/lakwarus/single-cartridge.git",
+              "repoUsername": "",
+              "repoPassword": ""
+            }
+          }
+        }
+      ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/autoscaling-policies/autoscaling-policy-sample-applications-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/autoscaling-policies/autoscaling-policy-sample-applications-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/autoscaling-policies/autoscaling-policy-sample-applications-test.json
new file mode 100644
index 0000000..5bd90ab
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/autoscaling-policies/autoscaling-policy-sample-applications-test.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-sample-applications-test",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 35
+        },
+        "memoryConsumption": {
+            "threshold": 45
+        },
+        "loadAverage": {
+            "threshold": 25
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/cartridges/mock/c1-sample-applications-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/cartridges/mock/c1-sample-applications-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/cartridges/mock/c1-sample-applications-test.json
new file mode 100755
index 0000000..b54d22b
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/cartridges/mock/c1-sample-applications-test.json
@@ -0,0 +1,45 @@
+{
+    "type": "c1-sample-applications-test",
+    "provider": "apache",
+    "host": "stratos.apache.org",
+    "category": "data",
+    "displayName": "c1-sample-applications-test",
+    "description": "c1-sample-applications-test 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": "mock-key"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/deployment-policies/deployment-policy-sample-applications-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/deployment-policies/deployment-policy-sample-applications-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/deployment-policies/deployment-policy-sample-applications-test.json
new file mode 100644
index 0000000..66d755a
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/deployment-policies/deployment-policy-sample-applications-test.json
@@ -0,0 +1,18 @@
+{
+    "id": "deployment-policy-sample-applications-test",
+    "networkPartitions": [
+        {
+            "id": "network-partition-sample-applications-test-1",
+            "partitionAlgo": "one-after-another",
+            "partitions": [
+                {
+                    "id": "partition-1",
+                    "partitionMax": 20
+                }
+            ]
+        }
+    ]
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/973c05b5/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/network-partitions/mock/network-partition-sample-applications-test-1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/network-partitions/mock/network-partition-sample-applications-test-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/network-partitions/mock/network-partition-sample-applications-test-1.json
new file mode 100644
index 0000000..8d7aed5
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/sample-application-startup-test/network-partitions/mock/network-partition-sample-applications-test-1.json
@@ -0,0 +1,15 @@
+{
+    "id": "network-partition-sample-applications-test-1",
+    "provider": "mock",
+    "partitions": [
+        {
+            "id": "partition-1",
+            "property": [
+                {
+                    "name": "region",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}