brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [1/3] brooklyn-server git commit: add test illustrating the failure in dacf18b831e1e5e1383d662a873643a3c3cabac6
Date Thu, 23 Feb 2017 11:07:21 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 5e947cef0 -> a0a713ee6


add test illustrating the failure in dacf18b831e1e5e1383d662a873643a3c3cabac6


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

Branch: refs/heads/master
Commit: 1bbe475818e5912f28009ff221b9fd75ce1ff4e2
Parents: 5cbfd5f
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Wed Feb 22 17:22:30 2017 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Wed Feb 22 17:22:30 2017 +0000

----------------------------------------------------------------------
 .../core/entity/ApplicationLifecycleStateTest.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1bbe4758/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
index d340d31..a27e3f3 100644
--- a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
@@ -29,6 +29,7 @@ import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
 import org.apache.brooklyn.core.entity.trait.FailingEntity;
 import org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport;
 import org.apache.brooklyn.core.test.entity.TestApplication;
+import org.apache.brooklyn.core.test.entity.TestApplicationImpl;
 import org.apache.brooklyn.core.test.entity.TestEntity;
 import org.apache.brooklyn.test.Asserts;
 import org.apache.brooklyn.util.collections.CollectionFunctionals;
@@ -70,6 +71,21 @@ public class ApplicationLifecycleStateTest extends BrooklynMgmtUnitTestSupport
{
         assertHealthEventually(app, Lifecycle.ON_FIRE, false);
     }
     
+    public static class TestApplicationDoStartFailing extends TestApplicationImpl {
+        @Override
+        protected void doStart(Collection<? extends Location> locations) {
+            super.doStart(locations);
+            throw new RuntimeException("deliberate failure");
+        }
+    }
+    public void testAppFailsCausesAppToFail() throws Exception {
+        TestApplication app = mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class,
+                TestApplicationDoStartFailing.class));
+        
+        startAndAssertException(app, ImmutableList.<Location>of());
+        assertHealthEventually(app, Lifecycle.ON_FIRE, false);
+    }
+    
     public void testSomeChildFailsOnStartCausesAppToFail() throws Exception {
         TestApplication app = mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class)
                 .child(EntitySpec.create(TestEntity.class))


Mime
View raw message