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: Fix non-deterministic test of SpecParameter by choosing correct entity
Date Fri, 05 Aug 2016 10:24:23 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master 94e09e0e4 -> ddb6acc92


Fix non-deterministic test of SpecParameter by choosing correct entity


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

Branch: refs/heads/master
Commit: 323433ed7c0ffcf08b0d4ca1c8d1fd575d646799
Parents: 56f7258
Author: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Authored: Thu Aug 4 15:01:53 2016 +0100
Committer: Andrew Donald Kennedy <andrew.kennedy@cloudsoftcorp.com>
Committed: Thu Aug 4 18:13:54 2016 +0100

----------------------------------------------------------------------
 .../catalog/SpecParameterUnwrappingTest.java        | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/323433ed/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
index 3d46058..4bbf137 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java
@@ -32,7 +32,6 @@ import org.testng.annotations.Test;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 
@@ -539,25 +538,30 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest {
         List<SpecParameter<?>> params = spec.getParameters();
         assertEquals(params.size(), 3);
         assertTrue(Iterables.tryFind(params, nameEqualTo("num")).isPresent());
-
+        
         Application app = (Application) createAndStartApplication(
                 "services:",
                 "  - type: " + ver(SYMBOLIC_NAME));
 
-        Optional<Entity> s = Iterables.tryFind(mgmt().getEntityManager().getEntitiesInApplication(app),
EntityPredicates.displayNameEqualTo("s"));
-        assertTrue(s.isPresent());
-        assertEquals(s.get().config().get(ConfigKeys.newIntegerConfigKey("test")).intValue(),
1234);
-
         Iterable<Entity> children = app.getChildren();
         Optional<Entity> a = Iterables.tryFind(children, EntityPredicates.displayNameEqualTo("a"));
         assertTrue(a.isPresent());
         assertEquals(a.get().config().get(NUM).intValue(), 1234);
+        Optional<Entity> as = Iterables.tryFind(a.get().getChildren(), EntityPredicates.displayNameEqualTo("s"));
+        assertTrue(as.isPresent());
+        assertEquals(as.get().config().get(ConfigKeys.newIntegerConfigKey("test")).intValue(),
1234);
         Optional<Entity> b = Iterables.tryFind(children, EntityPredicates.displayNameEqualTo("b"));
         assertTrue(b.isPresent());
         assertEquals(b.get().config().get(NUM).intValue(), 5678);
+        Optional<Entity> bs = Iterables.tryFind(b.get().getChildren(), EntityPredicates.displayNameEqualTo("s"));
+        assertTrue(bs.isPresent());
+        assertEquals(bs.get().config().get(ConfigKeys.newIntegerConfigKey("test")).intValue(),
5678);
         Optional<Entity> c = Iterables.tryFind(children, EntityPredicates.displayNameEqualTo("c"));
         assertTrue(c.isPresent());
         assertEquals(c.get().config().get(ConfigKeys.newIntegerConfigKey("test")).intValue(),
1234);
+        Optional<Entity> cs = Iterables.tryFind(c.get().getChildren(), EntityPredicates.displayNameEqualTo("s"));
+        assertTrue(cs.isPresent());
+        assertEquals(cs.get().config().get(ConfigKeys.newIntegerConfigKey("test")).intValue(),
1234);
     }
 
     @Test


Mime
View raw message