fix failing test on service going on_fire not aborting dependent configuration
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/bfb8737e Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/bfb8737e Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/bfb8737e Branch: refs/heads/master Commit: bfb8737e647357053f65d5bd305a4f6783ad2866 Parents: 5ec0a00 Author: Alex Heneveld <[email protected]> Authored: Mon Aug 25 16:35:55 2014 -0500 Committer: Alex Heneveld <[email protected]> Committed: Wed Aug 27 02:17:18 2014 -0400 ---------------------------------------------------------------------- .../java/brooklyn/event/basic/DependentConfiguration.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/bfb8737e/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java b/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java index 9d8bf4b..dd73cc8 100644 --- a/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java +++ b/core/src/main/java/brooklyn/event/basic/DependentConfiguration.java @@ -194,7 +194,15 @@ public class DependentConfiguration { semaphore.release(); } }})); + Object abortValue = abortCondition.source.getAttribute(abortCondition.sensor); + if (abortCondition.predicate.apply(abortValue)) { + abortion.add(new Exception("Abort due to "+abortCondition.source+" -> "+abortCondition.sensor)); + } + } + if (abortion.size() > 0) { + throw new CompoundRuntimeException("Aborted waiting for ready from "+source+" "+sensor, abortion); } + value = source.getAttribute(sensor); while (!ready.apply(value)) { String prevBlockingDetails = current.setBlockingDetails("Waiting for ready from "+source+" "+sensor+" (subscription)");
