stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [4/4] stratos git commit: Fixing isuues in integration tests
Date Thu, 06 Aug 2015 14:05:07 GMT
Fixing isuues in integration tests


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

Branch: refs/heads/tenant-isolation
Commit: 8382dd71fde55e2eab24baea06b99259a705e5ce
Parents: e1e6c1a
Author: Dinithi <dinithis@wso2.com>
Authored: Thu Aug 6 19:11:25 2015 +0530
Committer: Dinithi <dinithis@wso2.com>
Committed: Thu Aug 6 19:11:25 2015 +0530

----------------------------------------------------------------------
 .../tests/SampleApplicationsTest.java           | 30 ++++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/8382dd71/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
----------------------------------------------------------------------
diff --git a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
index f05bd51..3b89161 100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/SampleApplicationsTest.java
@@ -481,7 +481,7 @@ public class SampleApplicationsTest extends StratosTestServerManager {
                     restClient);
             assertEquals(unDeployed, true);
 
-            assertApplicationUndeploy("g-sc-G123-1");
+            assertApplicationUndeploy(bean.getApplicationUuid());
 
             boolean removed = applicationTest.removeApplication("g-sc-G123-1", endpoint,
                     restClient);
@@ -911,16 +911,16 @@ public class SampleApplicationsTest extends StratosTestServerManager
{
     /**
      * Assert application activation
      *
-     * @param applicationName
+     * @param applicationUuid
      */
-    private void assertApplicationUndeploy(String applicationName) {
+    private void assertApplicationUndeploy(String applicationUuid) {
         long startTime = System.currentTimeMillis();
-        Application application = ApplicationManager.getApplications().getApplication(applicationName);
+        Application application = ApplicationManager.getApplications().getApplication(applicationUuid);
         ApplicationContext applicationContext = null;
         try {
-            applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName);
+            applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationUuid);
         } catch (RemoteException e) {
-            log.error("Error while getting the application context for [application] " +
applicationName);
+            log.error("Error while getting the application context for [application] " +
applicationUuid);
         }
         while (((application != null) && application.getInstanceContextCount() >
0) ||
                 (applicationContext == null || applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING)))
{
@@ -928,11 +928,11 @@ public class SampleApplicationsTest extends StratosTestServerManager
{
                 Thread.sleep(1000);
             } catch (InterruptedException ignore) {
             }
-            application = ApplicationManager.getApplications().getApplication(applicationName);
+            application = ApplicationManager.getApplications().getApplication(applicationUuid);
             try {
-                applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationName);
+                applicationContext = AutoscalerServiceClient.getInstance().getApplication(applicationUuid);
             } catch (RemoteException e) {
-                log.error("Error while getting the application context for [application]
" + applicationName);
+                log.error("Error while getting the application context for [application]
" + applicationUuid);
             }
             if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT)
{
                 break;
@@ -940,29 +940,29 @@ public class SampleApplicationsTest extends StratosTestServerManager
{
         }
 
         assertNotNull(String.format("Application is not found: [application-id] %s",
-                applicationName), application);
+                applicationUuid), application);
         assertNotNull(String.format("Application Context is not found: [application-id] %s",
-                applicationName), applicationContext);
+                applicationUuid), applicationContext);
 
         //Force undeployment after the graceful deployment
         if (application.getInstanceContextCount() > 0 ||
                 applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING)) {
-            log.info("Force undeployment is going to start for the [application] " + applicationName);
+            log.info("Force undeployment is going to start for the [application] " + applicationUuid);
 
-            applicationTest.forceUndeployApplication(applicationName, endpoint, restClient);
+            applicationTest.forceUndeployApplication(applicationUuid, endpoint, restClient);
             while (application.getInstanceContextCount() > 0 ||
                     applicationContext.getStatus().equals(APPLICATION_STATUS_UNDEPLOYING))
{
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException ignore) {
                 }
-                application = ApplicationManager.getApplications().getApplication(applicationName);
+                application = ApplicationManager.getApplications().getApplication(applicationUuid);
                 if ((System.currentTimeMillis() - startTime) > APPLICATION_ACTIVATION_TIMEOUT)
{
                     break;
                 }
             }
         }
-        assertEquals(String.format("Application status did not change to Created: [application-id]
%s", applicationName),
+        assertEquals(String.format("Application status did not change to Created: [application-id]
%s", applicationUuid),
                 APPLICATION_STATUS_CREATED, applicationContext.getStatus());
 
     }


Mime
View raw message