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 2017/05/02 10:41:44 UTC

brooklyn-server git commit: minor test fix for service up computation

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 259d88e6f -> 547357d26


minor test fix for service up computation


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

Branch: refs/heads/master
Commit: 547357d269035ffae41d066f2db21d68664c3dd7
Parents: 259d88e
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue May 2 11:41:12 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue May 2 11:41:12 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/enricher/stock/Transformer.java  | 2 +-
 .../brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/547357d2/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
index 8b71bd7..3eae2d1 100644
--- a/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
+++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/Transformer.java
@@ -108,7 +108,7 @@ public class Transformer<T,U> extends AbstractTransformer<T,U> {
     }
     
     @SuppressWarnings("unchecked")
-    private <U> U resolveImmediately(Object rawVal, Sensor<U> targetSensor) {
+    private U resolveImmediately(Object rawVal, Sensor<U> targetSensor) {
         if (rawVal == Entities.UNCHANGED || rawVal == Entities.REMOVE) {
             // If it's a special marker-object, then don't try to transform it
             return (U) rawVal;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/547357d2/core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java b/core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java
index cc240ea..d21514b 100644
--- a/core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java
@@ -244,7 +244,9 @@ public class ServiceStateLogicTest extends BrooklynAppUnitTestSupport {
         // but running-quorum is still allAndAtLeastOne, so remains on-fire
         assertAttributeEqualsContinually(app, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.ON_FIRE);
         
-        // now add a child, it's still up and running because null values are ignored by default (i.e. we're still "empty")
+        // now add a child, not started so it doesn't say up or running or anything
+        // app should be still up and running because null values are ignored by default 
+        // (i.e. it is still "empty")
         entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
         assertAttributeEqualsContinually(app, Attributes.SERVICE_UP, true);
         assertAttributeEqualsContinually(app, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.ON_FIRE);
@@ -259,7 +261,8 @@ public class ServiceStateLogicTest extends BrooklynAppUnitTestSupport {
         appChildrenBasedEnricher.config().set(ComputeServiceIndicatorsFromChildrenAndMembers.IGNORE_ENTITIES_WITH_SERVICE_UP_NULL, false);
         assertAttributeEqualsEventually(app, Attributes.SERVICE_UP, false);
         
-        // set the entity to RUNNING and the app will be healthy again
+        // now set the entity to UP and expected RUNNING, it should go up and running, and so should app
+        ServiceNotUpLogic.updateNotUpIndicator(entity, INDICATOR_KEY_1, "Set then clear a problem to trigger SERVICE_UP enricher");
         ServiceNotUpLogic.clearNotUpIndicator(entity, INDICATOR_KEY_1);
         ServiceStateLogic.setExpectedState(entity, Lifecycle.RUNNING);
         assertAttributeEqualsEventually(app, Attributes.SERVICE_UP, true);