brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/2] brooklyn-server git commit: Minor tidy to LoopOverGroupMembersTestCase
Date Sat, 28 May 2016 14:13:21 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 41629718d -> 3ce00e8f0


Minor tidy to LoopOverGroupMembersTestCase

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

Branch: refs/heads/master
Commit: 22d9131dbc43158c19084457d26265ae42597765
Parents: 4162971
Author: Aled Sage <aled.sage@gmail.com>
Authored: Sat May 28 15:01:29 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Sat May 28 15:01:29 2016 +0100

----------------------------------------------------------------------
 .../framework/LoopOverGroupMembersTestCaseImpl.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/22d9131d/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java
----------------------------------------------------------------------
diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java
b/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java
index f4bb06d..58dce17 100644
--- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java
+++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java
@@ -67,17 +67,21 @@ public class LoopOverGroupMembersTestCaseImpl extends TargetableTestComponentImp
             return;
         }
 
+        // Create the child-assertions (one per group-member)
         Group group = (Group) target;
-
-        Collection<Entity> children = group.getMembers();
+        Collection<Entity> members = group.getMembers();
         boolean allSuccesful = true;
-        for (Entity child : children) {
-            testSpec.configure(TestCase.TARGET_ENTITY, child);
+        for (Entity member : members) {
+            EntitySpec<? extends TargetableTestComponent> testSpecCopy = EntitySpec.create(testSpec)
+                    .configure(TestCase.TARGET_ENTITY, member);
 
             try {
-                TargetableTestComponent targetableTestComponent = this.addChild(testSpec);
+                TargetableTestComponent targetableTestComponent = this.addChild(testSpecCopy);
                 targetableTestComponent.start(locations);
+                logger.debug("Task of {} successfully run, targetting {}", this, member);
             } catch (Throwable t) {
+                Exceptions.propagateIfFatal(t);
+                logger.warn("Problem in child test-case of "+this+", targetting "+member,
t);
                 allSuccesful = false;
             }
         }


Mime
View raw message