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/11/21 09:07:26 UTC

stratos git commit: fixing git-hook integration test

Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x 1ed041dd1 -> 540111794


fixing git-hook integration test


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

Branch: refs/heads/stratos-4.1.x
Commit: 540111794097d2bbb78985d9145e562069ddcaee
Parents: 1ed041d
Author: rajkumar <rr...@gmail.com>
Authored: Sat Nov 21 13:37:03 2015 +0530
Committer: rajkumar <rr...@gmail.com>
Committed: Sat Nov 21 13:37:03 2015 +0530

----------------------------------------------------------------------
 .../integration/tests/adc/GitHookTestCase.java  | 107 ++++++++++++++++---
 .../application-policy-1.json                   |  17 ---
 .../application-policy-git-hook-test.json       |  17 +++
 .../git-hook-test/applications/application.json |  25 -----
 .../applications/git-hook-test.json             |  25 +++++
 .../autoscaling-policy-1.json                   |  14 ---
 .../autoscaling-policy-git-hook-test.json       |  14 +++
 .../cartridges/mock/c1-git-hook-test.json       |  51 +++++++++
 .../git-hook-test/cartridges/mock/php.json      |  51 ---------
 .../deployment-policy-1.json                    |  15 ---
 .../deployment-policy-git-hook-test.json        |  15 +++
 .../mock/network-partition-1.json               |  15 ---
 .../mock/network-partition-git-hook-test.json   |  15 +++
 13 files changed, 227 insertions(+), 154 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/adc/GitHookTestCase.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/adc/GitHookTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/adc/GitHookTestCase.java
index e931f8a..873fe86 100644
--- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/adc/GitHookTestCase.java
+++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/adc/GitHookTestCase.java
@@ -21,9 +21,12 @@ package org.apache.stratos.integration.tests.adc;
 
 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.threading.StratosThreadPool;
 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.event.Event;
 import org.apache.stratos.messaging.listener.instance.notifier.ArtifactUpdateEventListener;
 import org.apache.stratos.messaging.message.receiver.instance.notifier.InstanceNotifierEventReceiver;
@@ -32,6 +35,8 @@ import org.testng.annotations.Test;
 import java.net.URI;
 import java.util.concurrent.ExecutorService;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
 import static org.testng.AssertJUnit.assertTrue;
 
 /**
@@ -42,6 +47,12 @@ public class GitHookTestCase extends StratosIntegrationTest {
     private static Log log = LogFactory.getLog(GitHookTestCase.class);
     private static final String RESOURCES_PATH = "/git-hook-test";
     private int artifactUpdateEvents = 0;
+    private static final String autoscalePolicyId = "autoscaling-policy-git-hook-test";
+    private static final String cartridgeId = "c1-git-hook-test";
+    private static final String networkPartitionId = "network-partition-git-hook-test";
+    private static final String depPolicyId = "deployment-policy-git-hook-test";
+    private static final String applicationId = "git-hook-test";
+    private static final String appPolicyId = "application-policy-git-hook-test";
 
     @Test(timeOut = GLOBAL_TEST_TIMEOUT, groups = {"adc", "smoke"})
     public void sendRepoNotify() throws Exception {
@@ -72,58 +83,120 @@ public class GitHookTestCase extends StratosIntegrationTest {
                 restClient.getJsonStringFromFile(RESOURCES_PATH + "/" + gitHookFile));
 
         while (artifactUpdateEvents < 2) {
-            log.debug("Waiting till artifact updated comes in... ");
+            log.info("Waiting till artifact updated comes in... ");
             Thread.sleep(1000);
         }
+
+        log.info("Waiting for application status to become ACTIVE...");
+        TopologyHandler.getInstance().assertApplicationStatus(applicationId, ApplicationStatus.Active);
+
+        undeployArtifacts();
     }
 
     private void deployArtifacts() throws Exception {
-        String autoscalingPolicyFile = "autoscaling-policy-1";
-        boolean autoscalingPolicyAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyFile + ".json",
+        boolean autoscalePolicyAdded = restClient.addEntity(
+                RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalePolicyId + ".json",
                 RestConstants.AUTOSCALING_POLICIES,
                 RestConstants.AUTOSCALING_POLICIES_NAME);
-        assertTrue(autoscalingPolicyAdded);
+        assertTrue(autoscalePolicyAdded);
 
-        String cartridgeFile = "php";
         boolean cartridgeAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeFile + ".json",
+                RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId + ".json",
                 RestConstants.CARTRIDGES,
                 RestConstants.CARTRIDGES_NAME);
         assertTrue(cartridgeAdded);
 
-        String networkPartitionFiile = "network-partition-1";
         boolean networkPartitionAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + networkPartitionFiile + ".json",
+                RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + networkPartitionId + ".json",
                 RestConstants.NETWORK_PARTITIONS,
                 RestConstants.NETWORK_PARTITIONS_NAME);
         assertTrue(networkPartitionAdded);
 
-        String depPolicyFile = "deployment-policy-1";
         boolean deploymentPolicyAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + depPolicyFile + ".json",
+                RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + depPolicyId + ".json",
                 RestConstants.DEPLOYMENT_POLICIES,
                 RestConstants.DEPLOYMENT_POLICIES_NAME);
         assertTrue(deploymentPolicyAdded);
 
-        String applicationFile = "application";
         boolean applicationAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + applicationFile + ".json",
+                RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + applicationId + ".json",
                 RestConstants.APPLICATIONS,
                 RestConstants.APPLICATIONS_NAME);
         assertTrue(applicationAdded);
 
-        String appPolicyFile = "application-policy-1";
+        ApplicationBean bean = (ApplicationBean) restClient
+                .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class,
+                        RestConstants.APPLICATIONS_NAME);
+        assertEquals(bean.getApplicationId(), applicationId);
+
         boolean appPolicyAdded = restClient.addEntity(
-                RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + appPolicyFile + ".json",
+                RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + appPolicyId + ".json",
                 RestConstants.APPLICATION_POLICIES,
                 RestConstants.APPLICATION_POLICIES_NAME);
         assertTrue(appPolicyAdded);
 
-
         boolean appDeployed = restClient.deployEntity(
-                RestConstants.APPLICATIONS + "/" + "single-cartridge-app" + RestConstants.APPLICATIONS_DEPLOY + "/" + appPolicyFile,
+                RestConstants.APPLICATIONS + "/" + applicationId + RestConstants.APPLICATIONS_DEPLOY + "/" + appPolicyId,
                 RestConstants.APPLICATIONS_NAME);
         assertTrue(appDeployed);
     }
+
+    private void undeployArtifacts() throws Exception{
+        log.info(String.format("Un-deploying the application [application id] %s", applicationId));
+        String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId +
+                RestConstants.APPLICATIONS_UNDEPLOY;
+
+        boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME);
+        assertTrue(unDeployed);
+
+        boolean undeploy = TopologyHandler.getInstance().assertApplicationUndeploy(applicationId);
+        if (!undeploy) {
+            //Need to forcefully undeploy the application
+            log.info(String.format("Force undeployment is going to start for the [application] %s", applicationId));
+
+            restClient.undeployEntity(RestConstants.APPLICATIONS + applicationId +
+                    RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS);
+
+            boolean forceUndeployed = TopologyHandler.getInstance().assertApplicationUndeploy(applicationId);
+            assertTrue(String.format("Forceful undeployment failed for the application %s", applicationId), forceUndeployed);
+        }
+
+        log.info("Removing the application [application id] sample-application-startup-test");
+        boolean removedApp = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId,
+                RestConstants.APPLICATIONS_NAME);
+        assertTrue(removedApp);
+
+        ApplicationBean beanRemoved = (ApplicationBean) restClient
+                .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class,
+                        RestConstants.APPLICATIONS_NAME);
+        assertNull(beanRemoved);
+
+        log.info(String.format("Removing the application policy [application policy id] %s", appPolicyId));
+        boolean removeAppPolicy = restClient
+                .removeEntity(RestConstants.APPLICATION_POLICIES, appPolicyId,
+                        RestConstants.APPLICATION_POLICIES_NAME);
+        assertTrue(removeAppPolicy);
+
+        log.info(String.format("Removing the cartridge [cartridge type] %s", cartridgeId));
+        boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId,
+                RestConstants.CARTRIDGES_NAME);
+        assertTrue(removedC1);
+
+        log.info(String.format("Removing the autoscaling policy [autoscaling policy id] %s", autoscalePolicyId));
+        boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalePolicyId,
+                RestConstants.AUTOSCALING_POLICIES_NAME);
+        assertTrue(removedAuto);
+
+        log.info(String.format("Removing the deployment policy [deployment policy id] %s", depPolicyId));
+        boolean removedDep = restClient
+                .removeEntity(RestConstants.DEPLOYMENT_POLICIES, depPolicyId,
+                        RestConstants.DEPLOYMENT_POLICIES_NAME);
+        assertTrue(removedDep);
+
+        log.info(String.format("Removing the network partition [network partition id] %s", networkPartitionId));
+        boolean removedNet = restClient
+                .removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId,
+                        RestConstants.NETWORK_PARTITIONS_NAME);
+        assertTrue(removedNet);
+    }
 }

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

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/applications/application.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/applications/application.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/applications/application.json
deleted file mode 100644
index 4043e4f..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/applications/application.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-    "applicationId": "single-cartridge-app",
-    "alias": "single-cartridge-app",
-    "multiTenant": false,
-    "components": {
-        "cartridges": [
-            {
-                "type": "php",
-                "cartridgeMin": 1,
-                "cartridgeMax": 5,
-                "subscribableInfo": {
-                    "alias": "my-php",
-                    "autoscalingPolicy": "autoscaling-policy-1",
-                    "deploymentPolicy": "deployment-policy-1",
-                    "artifactRepository": {
-                        "privateRepo": false,
-                        "repoUrl": "https://github.com/lakwarus/single-cartridge.git",
-                        "repoUsername": "",
-                        "repoPassword": ""
-                    }
-                }
-            }
-        ]
-    }
-}

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-1.json
deleted file mode 100644
index e5ac700..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-1.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-    "id": "autoscaling-policy-1",
-    "loadThresholds": {
-        "requestsInFlight": {
-            "threshold": 20
-        },
-        "memoryConsumption": {
-            "threshold": 70
-        },
-        "loadAverage": {
-            "threshold": 70
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-git-hook-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-git-hook-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-git-hook-test.json
new file mode 100644
index 0000000..c32cd01
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/autoscaling-policies/autoscaling-policy-git-hook-test.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-git-hook-test",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 20
+        },
+        "memoryConsumption": {
+            "threshold": 70
+        },
+        "loadAverage": {
+            "threshold": 70
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/c1-git-hook-test.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/c1-git-hook-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/c1-git-hook-test.json
new file mode 100644
index 0000000..42337a9
--- /dev/null
+++ b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/c1-git-hook-test.json
@@ -0,0 +1,51 @@
+{
+    "type": "c1-git-hook-test",
+    "provider": "apache",
+    "category": "framework",
+    "host": "c1-git-hook-test.stratos.org",
+    "displayName": "c1-git-hook-test",
+    "description": "c1-git-hook-test cartridge",
+    "version": "7",
+    "multiTenant": "false",
+    "portMapping": [
+        {
+            "name": "http-80",
+            "protocol": "http",
+            "port": "8080",
+            "proxyPort": "8280"
+        },
+        {
+            "name": "http-22",
+            "protocol": "tcp",
+            "port": "22",
+            "proxyPort": "8222"
+        }
+    ],
+    "deployment": {
+    },
+    "iaasProvider": [
+        {
+            "type": "mock",
+            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
+            "networkInterfaces": [
+                {
+                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
+                }
+            ],
+            "property": [
+                {
+                    "name": "instanceType",
+                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
+                },
+                {
+                    "name": "keyPair",
+                    "value": "reka"
+                },
+                {
+                    "name": "securityGroups",
+                    "value": "default"
+                }
+            ]
+        }
+    ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/php.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/php.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/php.json
deleted file mode 100644
index 5d53e3a..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/cartridges/mock/php.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
-    "type": "php",
-    "provider": "apache",
-    "category": "framework",
-    "host": "php.stratos.org",
-    "displayName": "php",
-    "description": "php Cartridge",
-    "version": "7",
-    "multiTenant": "false",
-    "portMapping": [
-        {
-            "name": "http-80",
-            "protocol": "http",
-            "port": "8080",
-            "proxyPort": "8280"
-        },
-        {
-            "name": "http-22",
-            "protocol": "tcp",
-            "port": "22",
-            "proxyPort": "8222"
-        }
-    ],
-    "deployment": {
-    },
-    "iaasProvider": [
-        {
-            "type": "mock",
-            "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e",
-            "networkInterfaces": [
-                {
-                    "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e"
-                }
-            ],
-            "property": [
-                {
-                    "name": "instanceType",
-                    "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594"
-                },
-                {
-                    "name": "keyPair",
-                    "value": "reka"
-                },
-                {
-                    "name": "securityGroups",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/deployment-policies/deployment-policy-1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/deployment-policies/deployment-policy-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/deployment-policies/deployment-policy-1.json
deleted file mode 100644
index a434226..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/deployment-policies/deployment-policy-1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "deployment-policy-1",
-    "networkPartitions": [
-        {
-            "id": "network-partition-1",
-            "partitionAlgo": "one-after-another",
-            "partitions": [
-                {
-                    "id": "partition-1",
-                    "partitionMax": 20
-                }
-            ]
-        }
-    ]
-}

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

http://git-wip-us.apache.org/repos/asf/stratos/blob/54011179/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/network-partitions/mock/network-partition-1.json
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/network-partitions/mock/network-partition-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/network-partitions/mock/network-partition-1.json
deleted file mode 100644
index 466da28..0000000
--- a/products/stratos/modules/integration/test-integration/src/test/resources/git-hook-test/network-partitions/mock/network-partition-1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "id": "network-partition-1",
-    "provider": "mock",
-    "partitions": [
-        {
-            "id": "partition-1",
-            "property": [
-                {
-                    "name": "region",
-                    "value": "default"
-                }
-            ]
-        }
-    ]
-}

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