Cleaning up test cases. Remove duplicate assertions. Fix formatting.
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/35eb6c22 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/35eb6c22 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/35eb6c22 Branch: refs/heads/stratos-4.1.x Commit: 35eb6c22d3611d63e2ecbfb2fbfdb49727d23971 Parents: 76199f0 Author: Akila Perera <[email protected]> Authored: Mon Nov 30 00:26:16 2015 +0530 Committer: Akila Perera <[email protected]> Committed: Mon Nov 30 00:33:47 2015 +0530 ---------------------------------------------------------------------- pom.xml | 2 +- .../ApplicationBurstingTestCase.java | 145 +++---- .../ApplicationStartupOrderTestCase.java | 165 ++++---- .../application/ApplicationUpdateTestCase.java | 131 +++--- .../application/GroupStartupOrderTestCase.java | 229 +++++------ .../GroupTerminationBehaviorTestCase.java | 196 ++++----- .../application/MetadataServiceTestCase.java | 32 +- ...PartitionOneAfterAnotherClusterTestCase.java | 148 ++++--- .../PartitionRoundRobinClusterTestCase.java | 129 +++--- .../SampleApplicationStartupTestCase.java | 46 ++- .../application/SampleApplicationsTestCase.java | 401 ++++++++++--------- .../SingleClusterScalingTestCase.java | 131 +++--- .../tests/cartridge/CartridgeGroupTestCase.java | 241 +++++++++++ .../tests/cartridge/CartridgeTestCase.java | 183 +++++++++ .../tests/group/CartridgeGroupTestCase.java | 251 ------------ .../tests/group/CartridgeTestCase.java | 183 --------- .../tests/iaas/IaaSProviderTestCase.java | 28 +- .../iaas/IaasProviderAttributeTestCase.java | 61 +-- .../policies/ApplicationPolicyTestCase.java | 111 ++--- .../policies/AutoscalingPolicyTestCase.java | 5 +- .../policies/DeploymentPolicyTestCase.java | 7 +- .../policies/NetworkPartitionTestCase.java | 7 +- .../integration/tests/users/TenantTestCase.java | 8 +- .../integration/tests/users/UserTestCase.java | 5 +- 24 files changed, 1364 insertions(+), 1481 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/35eb6c22/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 6b3cfc3..8125401 100644 --- a/pom.xml +++ b/pom.xml @@ -1795,7 +1795,7 @@ <maven.compiler.plugin.version>2.3.1</maven.compiler.plugin.version> <maven.wagon.ssh.extension.version>2.1</maven.wagon.ssh.extension.version> <maven.project.info.reports.plugin.version>2.4</maven.project.info.reports.plugin.version> - <maven.surefire.plugin.version>2.18</maven.surefire.plugin.version> + <maven.surefire.plugin.version>2.19</maven.surefire.plugin.version> <maven.resources.plugin.verison>2.7</maven.resources.plugin.verison> <maven.dependency.plugin.version>2.10</maven.dependency.plugin.version> <maven.incremental.build.plugin.version>1.3</maven.incremental.build.plugin.version> http://git-wip-us.apache.org/repos/asf/stratos/blob/35eb6c22/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java index ce1e0c4..b63525c 100644 --- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationBurstingTestCase.java @@ -22,24 +22,23 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.common.beans.application.ApplicationBean; import org.apache.stratos.common.beans.cartridge.CartridgeGroupBean; -import org.apache.stratos.common.beans.policy.deployment.ApplicationPolicyBean; import org.apache.stratos.integration.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.testng.Assert; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; -import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; /** * This will handle the application bursting test cases */ +@Test(groups = { "application", "app-burst" }) public class ApplicationBurstingTestCase extends StratosIntegrationTest { private static final Log log = LogFactory.getLog(ApplicationBurstingTestCase.class); + private TopologyHandler topologyHandler = TopologyHandler.getInstance(); private static final String RESOURCES_PATH = "/application-bursting-test"; private static final String autoscalingPolicyId = "autoscaling-policy-application-bursting-test"; private static final String cartridgeId1 = "esb-application-bursting-test"; @@ -52,62 +51,60 @@ public class ApplicationBurstingTestCase extends StratosIntegrationTest { private static final String applicationId = "application-bursting-test"; private static final String applicationPolicyId = "application-policy-application-bursting-test"; - @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"}) + @Test(timeOut = DEFAULT_APPLICATION_TEST_TIMEOUT) public void testApplicationBusting() throws Exception { - TopologyHandler topologyHandler = TopologyHandler.getInstance(); + log.info("Running ApplicationBurstingTestCase.testApplicationBusting test method..."); + long startTime = System.currentTimeMillis(); - boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH - + "/" + autoscalingPolicyId + ".json", + boolean addedScalingPolicy = restClient.addEntity( + RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertTrue(addedScalingPolicy); - boolean addedC1 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId1 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC1 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId1 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC1); - boolean addedC2 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId2 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC2 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId2 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC2); - boolean addedC3 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId3 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC3 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId3 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC3); boolean addedG1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(addedG1); CartridgeGroupBean beanG1 = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); + getEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, CartridgeGroupBean.class, + RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(beanG1.getName(), cartridgeGroupId); boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartition1 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartition1 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(addedN1); boolean addedN2 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartition2 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartition2 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(addedN2); boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - deploymentPolicyId + ".json", - RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); + deploymentPolicyId + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(addedDep); boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + - applicationId + ".json", RestConstants.APPLICATIONS, - RestConstants.APPLICATIONS_NAME); + applicationId + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); assertTrue(added); - ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean bean = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertEquals(bean.getApplicationId(), applicationId); boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + @@ -118,13 +115,11 @@ public class ApplicationBurstingTestCase extends StratosIntegrationTest { //deploy the application String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId + RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId; - boolean deployed = restClient.deployEntity(resourcePath, - RestConstants.APPLICATIONS_NAME); + boolean deployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); assertTrue(deployed); //Application active handling - topologyHandler.assertApplicationStatus(bean.getApplicationId(), - ApplicationStatus.Active); + TopologyHandler.getInstance().assertApplicationActiveStatus(applicationId); //Group active handling topologyHandler.assertGroupActivation(bean.getApplicationId()); @@ -132,29 +127,11 @@ public class ApplicationBurstingTestCase extends StratosIntegrationTest { //Cluster active handling topologyHandler.assertClusterActivation(bean.getApplicationId()); - boolean removedGroup = - restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - RestConstants.CARTRIDGE_GROUPS_NAME); - assertFalse(removedGroup); - - boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); - assertFalse(removedAuto); - - boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartition1, RestConstants.NETWORK_PARTITIONS_NAME); - assertFalse(removedNet); - - boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); - assertFalse(removedDep); - //Un-deploying the application String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId + RestConstants.APPLICATIONS_UNDEPLOY; - boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, - RestConstants.APPLICATIONS_NAME); + boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME); assertTrue(unDeployed); boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId); @@ -166,62 +143,56 @@ public class ApplicationBurstingTestCase extends StratosIntegrationTest { RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); boolean forceUndeployed = topologyHandler.assertApplicationUndeploy(applicationId); - assertTrue(String.format("Forceful undeployment failed for the application %s", - applicationId), forceUndeployed); + assertTrue(String.format("Forceful undeployment failed for the application %s", applicationId), + forceUndeployed); } - boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId, - RestConstants.APPLICATIONS_NAME); + boolean removed = restClient + .removeEntity(RestConstants.APPLICATIONS, applicationId, RestConstants.APPLICATIONS_NAME); assertTrue(removed); - ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean beanRemoved = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertNull(beanRemoved); - removedGroup = - restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - RestConstants.CARTRIDGE_GROUPS_NAME); + boolean removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(removedGroup); - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId1, - RestConstants.CARTRIDGES_NAME); + boolean removedC1 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId1, RestConstants.CARTRIDGES_NAME); assertTrue(removedC1); - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId2, - RestConstants.CARTRIDGES_NAME); + boolean removedC2 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId2, RestConstants.CARTRIDGES_NAME); assertTrue(removedC2); - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId3, - RestConstants.CARTRIDGES_NAME); + boolean removedC3 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId3, RestConstants.CARTRIDGES_NAME); assertTrue(removedC3); - removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); + boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, + RestConstants.AUTOSCALING_POLICIES_NAME); assertTrue(removedAuto); - removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); + boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(removedDep); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartition1, RestConstants.NETWORK_PARTITIONS_NAME); - assertFalse(removedNet); - - boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartition2, RestConstants.NETWORK_PARTITIONS_NAME); - assertFalse(removedN2); - - boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, - applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME); + boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId, + RestConstants.APPLICATION_POLICIES_NAME); assertTrue(removeAppPolicy); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartition1, RestConstants.NETWORK_PARTITIONS_NAME); + boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartition1, + RestConstants.NETWORK_PARTITIONS_NAME); Assert.assertTrue(removedNet); - removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartition2, RestConstants.NETWORK_PARTITIONS_NAME); + boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartition2, + RestConstants.NETWORK_PARTITIONS_NAME); Assert.assertTrue(removedN2); + long duration = System.currentTimeMillis() - startTime; + log.info(String.format("ApplicationBurstingTestCase completed in [duration] %s ms", duration)); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/stratos/blob/35eb6c22/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationStartupOrderTestCase.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationStartupOrderTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationStartupOrderTestCase.java index bde6b04..cbb222b 100644 --- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationStartupOrderTestCase.java +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationStartupOrderTestCase.java @@ -18,21 +18,25 @@ */ package org.apache.stratos.integration.tests.application; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; -import static org.testng.AssertJUnit.assertTrue; - +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.stratos.integration.common.RestConstants; import org.apache.stratos.integration.tests.StratosIntegrationTest; import org.junit.Rule; import org.junit.rules.ExpectedException; import org.testng.annotations.Test; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.junit.matchers.JUnitMatchers.containsString; +import static org.testng.AssertJUnit.assertTrue; + /** * Handling the startup order of the application */ +@Test(groups = { "application" }) public class ApplicationStartupOrderTestCase extends StratosIntegrationTest { + private static final Log log = LogFactory.getLog(ApplicationStartupOrderTestCase.class); private static final String RESOURCES_PATH = "/application-startup-order-test"; private static final String autoscalingPolicyId = "autoscaling-policy-application-startup-order-test"; private static final String cartridgeId1 = "esb-application-startup-order-test"; @@ -51,133 +55,130 @@ public class ApplicationStartupOrderTestCase extends StratosIntegrationTest { @Rule public ExpectedException thrown = ExpectedException.none(); - @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"}) + @Test(timeOut = DEFAULT_APPLICATION_TEST_TIMEOUT) public void testApplicationStartupOrder() throws Exception { - - thrown.expect(RuntimeException.class); - thrown.expectMessage( - "{\"status\":\"error\",\"message\":\"The startup-order defined in the [application] application-startup-order-test is not correct. [startup-order-alias] group.my-dbgroup3333 is not there in the application.\"}"); + log.info("Running ApplicationStartupOrderTestCase.testApplicationStartupOrder test method..."); + long startTime = System.currentTimeMillis(); + + thrown.expect(RuntimeException.class); + thrown.expectMessage("{\"status\":\"error\",\"message\":\"The startup-order defined in the [application] " + + "application-startup-order-test is not correct. [startup-order-alias] group.my-dbgroup3333 " + + "is not there in the application.\"}"); - boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH - + "/" + autoscalingPolicyId + ".json", + boolean addedScalingPolicy = restClient.addEntity( + RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertTrue(addedScalingPolicy); - boolean addedC1 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId1 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC1 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId1 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC1); - boolean addedC2 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId2 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC2 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId2 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC2); - boolean addedC3 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId3 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC3 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId3 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC3); - boolean addedC4 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId4 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC4 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId4 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC4); - boolean addedC5 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId5 + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC5 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + cartridgeId5 + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC5); boolean addedG1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId1 + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId1 + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(addedG1); boolean addedG2 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId2 + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId2 + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(addedG2); boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartitionId1 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartitionId1 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(addedN1); boolean addedN2 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartitionId2 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartitionId2 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(addedN2); boolean addedDep1 = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - deploymentPolicyId1 + ".json", - RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); + deploymentPolicyId1 + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(addedDep1); boolean addedDep2 = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - deploymentPolicyId2 + ".json", - RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); + deploymentPolicyId2 + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(addedDep2); - - try { + + try { restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + - applicationId + ".json", RestConstants.APPLICATIONS, - RestConstants.APPLICATIONS_NAME); - fail("Should throw an exception if the aliases mentioned in dependency order section are not defined"); - } catch (Exception e) { - assertThat( - e.getMessage(),containsString("The startup-order defined in the [application] application-startup-order-test is not correct. [startup-order-alias] group.my-dbgroup3333 is not there in the application.")); - } - // Clean up - boolean removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId1, - RestConstants.CARTRIDGE_GROUPS_NAME); + applicationId + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); + fail("Should throw an exception if the aliases mentioned in dependency order section are not defined"); + } catch (Exception e) { + assertThat(e.getMessage(), containsString( + "The startup-order defined in the [application] application-startup-order-test is not correct. " + + "[startup-order-alias] group.my-dbgroup3333 is not there in the application.")); + } + // Clean up + boolean removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId1, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(removedGroup); - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId2, - RestConstants.CARTRIDGE_GROUPS_NAME); + removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId2, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(removedGroup); - boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); - assertTrue(removedAuto); - - boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId1, RestConstants.DEPLOYMENT_POLICIES_NAME); + boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, + RestConstants.AUTOSCALING_POLICIES_NAME); + assertTrue(removedAuto); + + boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId1, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(removedDep); - - removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId2, RestConstants.DEPLOYMENT_POLICIES_NAME); + + removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId2, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(removedDep); - - boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, + + boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(removedNet); - - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId2, + + removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId2, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(removedNet); - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId1, - RestConstants.CARTRIDGES_NAME); + boolean removedC1 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId1, RestConstants.CARTRIDGES_NAME); assertTrue(removedC1); - - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId2, - RestConstants.CARTRIDGES_NAME); + + boolean removedC2 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId2, RestConstants.CARTRIDGES_NAME); assertTrue(removedC2); - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId3, - RestConstants.CARTRIDGES_NAME); + boolean removedC3 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId3, RestConstants.CARTRIDGES_NAME); assertTrue(removedC3); - boolean removedC4 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId4, - RestConstants.CARTRIDGES_NAME); + boolean removedC4 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId4, RestConstants.CARTRIDGES_NAME); assertTrue(removedC4); - boolean removedC5 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId5, - RestConstants.CARTRIDGES_NAME); + boolean removedC5 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId5, RestConstants.CARTRIDGES_NAME); assertTrue(removedC5); + long duration = System.currentTimeMillis() - startTime; + log.info(String.format("ApplicationStartupOrderTestCase completed in [duration] %s ms", duration)); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/stratos/blob/35eb6c22/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java index 0d2c5f7..fcf2573 100644 --- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/ApplicationUpdateTestCase.java @@ -23,12 +23,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.common.beans.application.ApplicationBean; import org.apache.stratos.common.beans.cartridge.CartridgeGroupBean; -import org.apache.stratos.common.beans.policy.deployment.ApplicationPolicyBean; import org.apache.stratos.integration.common.RestConstants; import org.apache.stratos.integration.common.TopologyHandler; import org.apache.stratos.integration.tests.StratosIntegrationTest; import org.apache.stratos.messaging.domain.application.Application; -import org.apache.stratos.messaging.domain.application.ApplicationStatus; import org.apache.stratos.messaging.domain.application.ClusterDataHolder; import org.apache.stratos.messaging.domain.application.Group; import org.apache.stratos.messaging.message.receiver.application.ApplicationManager; @@ -40,7 +38,9 @@ import static junit.framework.Assert.assertTrue; /** * Sample application tests with application add, . */ +@Test(groups = { "application", "app-update" }) public class ApplicationUpdateTestCase extends StratosIntegrationTest { + private TopologyHandler topologyHandler = TopologyHandler.getInstance(); private static final Log log = LogFactory.getLog(ApplicationUpdateTestCase.class); private static final String RESOURCES_PATH = "/application-update-test"; private static final String autoscalingPolicyId = "autoscaling-policy-application-update-test"; @@ -55,12 +55,13 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { private static final String applicationPolicyId = "application-policy-application-update-test"; private static final String applicationId2 = "g-sc-G123-1-application-update-test-v1"; - @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"}) + @Test(timeOut = DEFAULT_APPLICATION_TEST_TIMEOUT) public void testDeployApplication() throws Exception { - TopologyHandler topologyHandler = TopologyHandler.getInstance(); + log.info("Running ApplicationUpdateTestCase.testDeployApplication test method..."); + long startTime = System.currentTimeMillis(); - boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH - + "/" + autoscalingPolicyId + ".json", + boolean addedScalingPolicy = restClient.addEntity( + RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(addedScalingPolicy, true); @@ -80,37 +81,34 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { assertEquals(addedC3, true); boolean addedG1 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(addedG1, true); CartridgeGroupBean beanG1 = (CartridgeGroupBean) restClient. - getEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - CartridgeGroupBean.class, RestConstants.CARTRIDGE_GROUPS_NAME); + getEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, CartridgeGroupBean.class, + RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(beanG1.getName(), cartridgeGroupId); boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartitionId1 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartitionId1 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN1, true); boolean addedN2 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartitionId2 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartitionId2 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(addedN2, true); boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - deploymentPolicyId + ".json", - RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); + deploymentPolicyId + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(addedDep, true); boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + - applicationId1 + ".json", RestConstants.APPLICATIONS, - RestConstants.APPLICATIONS_NAME); + applicationId1 + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); assertEquals(added, true); - ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId1, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean bean = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId1, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertEquals(bean.getApplicationId(), applicationId1); boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + @@ -121,12 +119,11 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { //deploy the application String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId1 + RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId; - boolean deployed = restClient.deployEntity(resourcePath, - RestConstants.APPLICATIONS_NAME); + boolean deployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); assertEquals(deployed, true); //Application active handling - topologyHandler.assertApplicationStatus(applicationId1, ApplicationStatus.Active); + TopologyHandler.getInstance().assertApplicationActiveStatus(applicationId1); //Group active handling topologyHandler.assertGroupActivation(applicationId1); @@ -136,12 +133,12 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { //Updating application boolean updated = restClient.updateEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + - applicationId2 + ".json", RestConstants.APPLICATIONS, - RestConstants.APPLICATIONS_NAME); + applicationId2 + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); assertEquals(updated, true); - ApplicationBean updatedBean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId1, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean updatedBean = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId1, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertEquals(updatedBean.getApplicationId(), applicationId1); //Need to validate whether the updated taken into the applications Topology @@ -165,29 +162,27 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { topologyHandler.assertClusterMinMemberCount(bean.getApplicationId(), 2); - boolean removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - RestConstants.CARTRIDGE_GROUPS_NAME); + boolean removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(removedGroup, false); - boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); + boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, + RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(removedAuto, false); - boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, + boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedNet, false); - boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); + boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(removedDep, false); //Un-deploying the application String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId1 + RestConstants.APPLICATIONS_UNDEPLOY; - boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, - RestConstants.APPLICATIONS_NAME); + boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME); assertEquals(unDeployed, true); boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId1); @@ -198,63 +193,65 @@ public class ApplicationUpdateTestCase extends StratosIntegrationTest { restClient.undeployEntity(RestConstants.APPLICATIONS + "/" + applicationId1 + RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); - boolean forceUndeployed = - topologyHandler.assertApplicationUndeploy(applicationId1); - assertTrue(String.format("Forceful undeployment failed for the application %s", - applicationId1), forceUndeployed); + boolean forceUndeployed = topologyHandler.assertApplicationUndeploy(applicationId1); + assertTrue(String.format("Forceful undeployment failed for the application %s", applicationId1), + forceUndeployed); } - boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId1, - RestConstants.APPLICATIONS_NAME); + boolean removed = restClient + .removeEntity(RestConstants.APPLICATIONS, applicationId1, RestConstants.APPLICATIONS_NAME); assertEquals(removed, true); - ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId1, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean beanRemoved = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId1, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertEquals(beanRemoved, null); - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, - RestConstants.CARTRIDGE_GROUPS_NAME); + removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId, RestConstants.CARTRIDGE_GROUPS_NAME); assertEquals(removedGroup, true); - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId1, - RestConstants.CARTRIDGES_NAME); + boolean removedC1 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId1, RestConstants.CARTRIDGES_NAME); assertEquals(removedC1, true); - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId2, - RestConstants.CARTRIDGES_NAME); + boolean removedC2 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId2, RestConstants.CARTRIDGES_NAME); assertEquals(removedC2, true); - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, cartridgeId3, - RestConstants.CARTRIDGES_NAME); + boolean removedC3 = restClient + .removeEntity(RestConstants.CARTRIDGES, cartridgeId3, RestConstants.CARTRIDGES_NAME); assertEquals(removedC3, true); - removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); + removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, + RestConstants.AUTOSCALING_POLICIES_NAME); assertEquals(removedAuto, true); - removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); + removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertEquals(removedDep, true); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); + removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId1, + RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedNet, false); - boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId2, RestConstants.NETWORK_PARTITIONS_NAME); + boolean removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId2, + RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN2, false); - boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, - applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME); + boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId, + RestConstants.APPLICATION_POLICIES_NAME); assertEquals(removeAppPolicy, true); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); + removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId1, + RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedNet, true); - removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId2, RestConstants.NETWORK_PARTITIONS_NAME); + removedN2 = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId2, + RestConstants.NETWORK_PARTITIONS_NAME); assertEquals(removedN2, true); + long duration = System.currentTimeMillis() - startTime; + log.info(String.format("ApplicationBurstingTestCase completed in [duration] %s ms", duration)); } } http://git-wip-us.apache.org/repos/asf/stratos/blob/35eb6c22/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java index 4c7384c..5425339 100644 --- a/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java +++ b/products/stratos/modules/integration/test-integration/src/test/java/org/apache/stratos/integration/tests/application/GroupStartupOrderTestCase.java @@ -24,21 +24,21 @@ import org.apache.stratos.common.beans.application.ApplicationBean; 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.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; /** * Handling the startup order of the group */ +@Test(groups = { "application" }) public class GroupStartupOrderTestCase extends StratosIntegrationTest { private static final Log log = LogFactory.getLog(GroupStartupOrderTestCase.class); + private TopologyHandler topologyHandler = TopologyHandler.getInstance(); private static final String RESOURCES_PATH = "/group-startup-order-test"; private static final String autoscalingPolicyId = "autoscaling-policy-group-startup-order-test"; private static final String esbCartridgeId = "esb-group-startup-order-test"; @@ -54,81 +54,78 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { private static final String deploymentPolicyId = "deployment-policy-group-startup-order-test"; private static final String applicationPolicyId = "application-policy-group-startup-order-test"; private static final String applicationId = "group-startup-order-test"; - private static final int GROUP_ACTIVE_TIMEOUT = 300000; - private static final int NODES_START_PARALLEL_TIMEOUT = 30000; + private static final int GROUP_ACTIVE_TIMEOUT = 500000; + private static final int NODES_START_PARALLEL_TIMEOUT = 500000; - - @Test(timeOut = APPLICATION_TEST_TIMEOUT, groups = {"stratos.application.deployment"}) + @Test(timeOut = DEFAULT_APPLICATION_TEST_TIMEOUT) public void testTerminationBehavior() throws Exception { + log.info("Running GroupStartupOrderTestCase.testTerminationBehavior test method..."); + long startTime = System.currentTimeMillis(); - TopologyHandler topologyHandler = TopologyHandler.getInstance(); - boolean addedScalingPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH - + "/" + autoscalingPolicyId + ".json", + boolean addedScalingPolicy = restClient.addEntity( + RESOURCES_PATH + RestConstants.AUTOSCALING_POLICIES_PATH + "/" + autoscalingPolicyId + ".json", RestConstants.AUTOSCALING_POLICIES, RestConstants.AUTOSCALING_POLICIES_NAME); assertTrue(addedScalingPolicy); - boolean addedC1 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + esbCartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC1 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + esbCartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC1); - boolean addedC2 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + phpCartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC2 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + phpCartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC2); - boolean addedC3 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + stratosLbCartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC3 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + stratosLbCartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC3); - boolean addedC5 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat1CartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC5 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat1CartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC5); - boolean addedC6 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat2CartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC6 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat2CartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC6); - boolean addedC7 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat3CartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC7 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcat3CartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC7); - boolean addedC8 = restClient.addEntity( - RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcatCartridgeId + ".json", - RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); + boolean addedC8 = restClient + .addEntity(RESOURCES_PATH + RestConstants.CARTRIDGES_PATH + "/" + tomcatCartridgeId + ".json", + RestConstants.CARTRIDGES, RestConstants.CARTRIDGES_NAME); assertTrue(addedC8); boolean addedG2 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId1 + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId1 + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(addedG2); boolean addedG3 = restClient.addEntity(RESOURCES_PATH + RestConstants.CARTRIDGE_GROUPS_PATH + - "/" + cartridgeGroupId2 + ".json", RestConstants.CARTRIDGE_GROUPS, - RestConstants.CARTRIDGE_GROUPS_NAME); + "/" + cartridgeGroupId2 + ".json", RestConstants.CARTRIDGE_GROUPS, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(addedG3); boolean addedN1 = restClient.addEntity(RESOURCES_PATH + RestConstants.NETWORK_PARTITIONS_PATH + "/" + - networkPartitionId1 + ".json", - RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); + networkPartitionId1 + ".json", RestConstants.NETWORK_PARTITIONS, RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(addedN1); boolean addedDep = restClient.addEntity(RESOURCES_PATH + RestConstants.DEPLOYMENT_POLICIES_PATH + "/" + - deploymentPolicyId + ".json", - RestConstants.DEPLOYMENT_POLICIES, RestConstants.DEPLOYMENT_POLICIES_NAME); + deploymentPolicyId + ".json", RestConstants.DEPLOYMENT_POLICIES, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(addedDep); boolean added = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATIONS_PATH + "/" + - applicationId + ".json", RestConstants.APPLICATIONS, - RestConstants.APPLICATIONS_NAME); + applicationId + ".json", RestConstants.APPLICATIONS, RestConstants.APPLICATIONS_NAME); assertTrue(added); - ApplicationBean bean = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean bean = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertEquals(bean.getApplicationId(), applicationId); boolean addAppPolicy = restClient.addEntity(RESOURCES_PATH + RestConstants.APPLICATION_POLICIES_PATH + "/" + @@ -139,23 +136,20 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { //deploy the application String resourcePath = RestConstants.APPLICATIONS + "/" + applicationId + RestConstants.APPLICATIONS_DEPLOY + "/" + applicationPolicyId; - boolean deployed = restClient.deployEntity(resourcePath, - RestConstants.APPLICATIONS_NAME); + boolean deployed = restClient.deployEntity(resourcePath, RestConstants.APPLICATIONS_NAME); assertTrue(deployed); - String group6 = topologyHandler.generateId(bean.getApplicationId(), - "my-group6-group-startup-order-test", bean.getApplicationId() + "-1"); + String group6 = topologyHandler.generateId(bean.getApplicationId(), "my-group6-group-startup-order-test", + bean.getApplicationId() + "-1"); - String group8 = topologyHandler.generateId(bean.getApplicationId(), - "my-group8-group-startup-order-test", bean.getApplicationId() + "-1"); + String group8 = topologyHandler.generateId(bean.getApplicationId(), "my-group8-group-startup-order-test", + bean.getApplicationId() + "-1"); String lb = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-stratos-lb-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-stratos-lb-group-startup-order-test"); String tomcat = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-tomcat-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-tomcat-group-startup-order-test"); assertCreationOfNodes(lb, tomcat); @@ -165,47 +159,41 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { assertCreationOfNodes(tomcat, group8); - String group7 = topologyHandler.generateId(bean.getApplicationId(), - "my-group7-group-startup-order-test", bean.getApplicationId() + "-1"); + String group7 = topologyHandler.generateId(bean.getApplicationId(), "my-group7-group-startup-order-test", + bean.getApplicationId() + "-1"); - String groupTom2 = topologyHandler.generateId(bean.getApplicationId(), - "my-group6-group-tom2-group-startup-order-test", bean.getApplicationId() + "-1"); + String groupTom2 = topologyHandler + .generateId(bean.getApplicationId(), "my-group6-group-tom2-group-startup-order-test", + bean.getApplicationId() + "-1"); assertCreationOfNodesInParallel(group7, groupTom2); String group7Tomcat = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-group7-tomcat-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-group7-tomcat-group-startup-order-test"); String group7Tomcat1 = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-group7-tomcat1-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-group7-tomcat1-group-startup-order-test"); assertCreationOfNodes(group7Tomcat, group7Tomcat1); String groupTom2Tomcat2 = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-group-tom2-tomcat2-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-group-tom2-tomcat2-group-startup-order-test"); String groupTom2Tomcat3 = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-group-tom2-tomcat3-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-group-tom2-tomcat3-group-startup-order-test"); assertCreationOfNodes(groupTom2Tomcat2, groupTom2Tomcat3); String group8Tomcat2 = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-tomcat2-group8-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-tomcat2-group8-group-startup-order-test"); String group8Tomcat = topologyHandler. - getClusterIdFromAlias(bean.getApplicationId(), - "my-tomcat-group8-group-startup-order-test"); + getClusterIdFromAlias(bean.getApplicationId(), "my-tomcat-group8-group-startup-order-test"); assertCreationOfNodesInParallel(group8Tomcat2, group8Tomcat); //Application active handling - topologyHandler.assertApplicationStatus(bean.getApplicationId(), - ApplicationStatus.Active); + TopologyHandler.getInstance().assertApplicationActiveStatus(bean.getApplicationId()); //Group active handling topologyHandler.assertGroupActivation(bean.getApplicationId()); @@ -213,36 +201,11 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { //Cluster active handling topologyHandler.assertClusterActivation(bean.getApplicationId()); - boolean removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId1, - RestConstants.CARTRIDGE_GROUPS_NAME); - assertFalse(removedGroup); - - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId2, - RestConstants.CARTRIDGE_GROUPS_NAME); - assertFalse(removedGroup); - - boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); - assertFalse(removedAuto); - - boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, - RestConstants.NETWORK_PARTITIONS_NAME); - //Trying to remove the used network partition - assertFalse(removedNet); - - boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); - assertFalse(removedDep); - //Un-deploying the application String resourcePathUndeploy = RestConstants.APPLICATIONS + "/" + applicationId + RestConstants.APPLICATIONS_UNDEPLOY; - boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, - RestConstants.APPLICATIONS_NAME); + boolean unDeployed = restClient.undeployEntity(resourcePathUndeploy, RestConstants.APPLICATIONS_NAME); assertTrue(unDeployed); boolean undeploy = topologyHandler.assertApplicationUndeploy(applicationId); @@ -254,66 +217,65 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { RestConstants.APPLICATIONS_UNDEPLOY + "?force=true", RestConstants.APPLICATIONS); boolean forceUndeployed = topologyHandler.assertApplicationUndeploy(applicationId); - assertTrue(String.format("Forceful undeployment failed for the application %s", - applicationId), forceUndeployed); + assertTrue(String.format("Forceful undeployment failed for the application %s", applicationId), + forceUndeployed); } - boolean removed = restClient.removeEntity(RestConstants.APPLICATIONS, applicationId, - RestConstants.APPLICATIONS_NAME); + boolean removed = restClient + .removeEntity(RestConstants.APPLICATIONS, applicationId, RestConstants.APPLICATIONS_NAME); assertTrue(removed); - ApplicationBean beanRemoved = (ApplicationBean) restClient.getEntity(RestConstants.APPLICATIONS, - applicationId, ApplicationBean.class, RestConstants.APPLICATIONS_NAME); + ApplicationBean beanRemoved = (ApplicationBean) restClient + .getEntity(RestConstants.APPLICATIONS, applicationId, ApplicationBean.class, + RestConstants.APPLICATIONS_NAME); assertNull(beanRemoved); - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId1, RestConstants.CARTRIDGE_GROUPS_NAME); + boolean removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId1, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(removedGroup); - removedGroup = restClient.removeEntity(RestConstants.CARTRIDGE_GROUPS, - cartridgeGroupId2, RestConstants.CARTRIDGE_GROUPS_NAME); + removedGroup = restClient + .removeEntity(RestConstants.CARTRIDGE_GROUPS, cartridgeGroupId2, RestConstants.CARTRIDGE_GROUPS_NAME); assertTrue(removedGroup); - boolean removedC1 = restClient.removeEntity(RestConstants.CARTRIDGES, stratosLbCartridgeId, - RestConstants.CARTRIDGES_NAME); + boolean removedC1 = restClient + .removeEntity(RestConstants.CARTRIDGES, stratosLbCartridgeId, RestConstants.CARTRIDGES_NAME); assertTrue(removedC1); - boolean removedC2 = restClient.removeEntity(RestConstants.CARTRIDGES,tomcatCartridgeId, - RestConstants.CARTRIDGES_NAME); + boolean removedC2 = restClient + .removeEntity(RestConstants.CARTRIDGES, tomcatCartridgeId, RestConstants.CARTRIDGES_NAME); assertTrue(removedC2); - boolean removedC3 = restClient.removeEntity(RestConstants.CARTRIDGES, tomcat1CartridgeId, - RestConstants.CARTRIDGES_NAME); + boolean removedC3 = restClient + .removeEntity(RestConstants.CARTRIDGES, tomcat1CartridgeId, RestConstants.CARTRIDGES_NAME); assertTrue(removedC3); - boolean removedC4 = restClient.removeEntity(RestConstants.CARTRIDGES, tomcat2CartridgeId, - RestConstants.CARTRIDGES_NAME); + boolean removedC4 = restClient + .removeEntity(RestConstants.CARTRIDGES, tomcat2CartridgeId, RestConstants.CARTRIDGES_NAME); assertTrue(removedC4); - boolean removedC5 = restClient.removeEntity(RestConstants.CARTRIDGES, tomcat3CartridgeId, - RestConstants.CARTRIDGES_NAME); + boolean removedC5 = restClient + .removeEntity(RestConstants.CARTRIDGES, tomcat3CartridgeId, RestConstants.CARTRIDGES_NAME); assertTrue(removedC5); - removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, - autoscalingPolicyId, RestConstants.AUTOSCALING_POLICIES_NAME); + boolean removedAuto = restClient.removeEntity(RestConstants.AUTOSCALING_POLICIES, autoscalingPolicyId, + RestConstants.AUTOSCALING_POLICIES_NAME); assertTrue(removedAuto); - removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, - deploymentPolicyId, RestConstants.DEPLOYMENT_POLICIES_NAME); + boolean removedDep = restClient.removeEntity(RestConstants.DEPLOYMENT_POLICIES, deploymentPolicyId, + RestConstants.DEPLOYMENT_POLICIES_NAME); assertTrue(removedDep); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); - assertFalse(removedNet); - - boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, - applicationPolicyId, RestConstants.APPLICATION_POLICIES_NAME); + boolean removeAppPolicy = restClient.removeEntity(RestConstants.APPLICATION_POLICIES, applicationPolicyId, + RestConstants.APPLICATION_POLICIES_NAME); assertTrue(removeAppPolicy); - removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, - networkPartitionId1, RestConstants.NETWORK_PARTITIONS_NAME); + boolean removedNet = restClient.removeEntity(RestConstants.NETWORK_PARTITIONS, networkPartitionId1, + RestConstants.NETWORK_PARTITIONS_NAME); assertTrue(removedNet); + long duration = System.currentTimeMillis() - startTime; + log.info(String.format("GroupStartupOrderTestCase completed in [duration] %s ms", duration)); } private void assertCreationOfNodes(String firstNodeId, String secondNodeId) { @@ -325,8 +287,7 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { while (!activeMembers.containsKey(firstNodeId)) { try { Thread.sleep(1000); - } - catch (InterruptedException ignored) { + } catch (InterruptedException ignored) { } activeMembers = TopologyHandler.getInstance().getActivateddMembers(); if ((System.currentTimeMillis() - startTime) > GROUP_ACTIVE_TIMEOUT) { @@ -338,8 +299,7 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { while (!createdMembers.containsKey(secondNodeId)) { try { Thread.sleep(1000); - } - catch (InterruptedException ignore) { + } catch (InterruptedException ignore) { } createdMembers = TopologyHandler.getInstance().getCreatedMembers(); if ((System.currentTimeMillis() - startTime) > GROUP_ACTIVE_TIMEOUT) { @@ -361,8 +321,7 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { while (!(createdMembers.containsKey(firstNodeId) && createdMembers.containsKey(firstNodeId))) { try { Thread.sleep(1000); - } - catch (InterruptedException ignored) { + } catch (InterruptedException ignored) { } createdMembers = TopologyHandler.getInstance().getCreatedMembers(); if ((System.currentTimeMillis() - startTime) > NODES_START_PARALLEL_TIMEOUT) { @@ -372,4 +331,4 @@ public class GroupStartupOrderTestCase extends StratosIntegrationTest { assertTrue(createdMembers.containsKey(firstNodeId)); assertTrue(createdMembers.containsKey(firstNodeId)); } -} \ No newline at end of file +}
