You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:50:21 UTC

[24/50] [abbrv] brooklyn-server git commit: Wait all apps running in BrooklynNote test

Wait all apps running in BrooklynNote test


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/531159d2
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/531159d2
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/531159d2

Branch: refs/heads/0.7.0-incubating
Commit: 531159d2cbee62ce10c71b3555a1c25ffabd8a22
Parents: fc62114
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Jun 24 22:03:56 2015 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Thu Jun 25 17:20:13 2015 +0300

----------------------------------------------------------------------
 .../entity/brooklynnode/BrooklynNodeIntegrationTest.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/531159d2/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
index ba6cd92..182c24a 100644
--- a/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
+++ b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynNodeIntegrationTest.java
@@ -48,6 +48,7 @@ import brooklyn.entity.basic.BasicApplication;
 import brooklyn.entity.basic.BasicApplicationImpl;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.EntityLocal;
+import brooklyn.entity.basic.Lifecycle;
 import brooklyn.entity.basic.SoftwareProcess.StopSoftwareParameters.StopMode;
 import brooklyn.entity.brooklynnode.BrooklynNode.DeployBlueprintEffector;
 import brooklyn.entity.brooklynnode.BrooklynNode.ExistingFileBehaviour;
@@ -362,15 +363,24 @@ services:
         HttpTestUtils.assertHttpStatusCodeEventuallyEquals(webConsoleUri+"/v1/applications", 200);
     }
 
+    // TODO Should introduce startup stages and let the client select which stage it expects to be complete
     protected void waitForApps(final URI webConsoleUri, final int num) {
         waitForApps(webConsoleUri.toString());
         
         // e.g. [{"id":"UnBqPcqg","spec":{"name":"Application (UnBqPcqg)","type":"brooklyn.entity.basic.BasicApplication","locations":["pOL4NtiW"]},"status":"RUNNING","links":{"self":"/v1/applications/UnBqPcqg","entities":"/v1/applications/UnBqPcqg/entities"}}]
         Asserts.succeedsEventually(new Runnable() {
+            @Override
             public void run() {
+                //Wait all apps to become managed
                 String appsContent = HttpTestUtils.getContent(webConsoleUri.toString()+"/v1/applications");
                 List<String> appIds = parseJsonList(appsContent, ImmutableList.of("id"), String.class);
                 assertEquals(appIds.size(), num);
+                
+                // and then to start
+                List<String> statuses = parseJsonList(appsContent, ImmutableList.of("status"), String.class);
+                for (String status : statuses) {
+                    assertEquals(status, Lifecycle.RUNNING.toString().toUpperCase());
+                }
             }});
     }
 
@@ -541,7 +551,6 @@ services:
         File pidFile = new File(getDriver(brooklynNode).getPidFile());
         assertTrue(isPidRunning(pidFile));
         
-        Maybe<MachineLocation> l = Locations.findUniqueMachineLocation(brooklynNode.getLocations());
         brooklynNode.invoke(eff, Collections.<String, Object>emptyMap()).getUnchecked();
 
         // Note can't use driver.isRunning to check shutdown; can't invoke scripts on an unmanaged entity