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 2016/02/01 18:49:29 UTC
[43/50] brooklyn-server git commit: Adds
testInheritedConfigAvailableDeepInHierarchy
Adds testInheritedConfigAvailableDeepInHierarchy
- Was added while trying to track down bug @grkvlt was seeing,
but this wasn't the cause! A useful test to have though.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/6ea7b07e
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/6ea7b07e
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/6ea7b07e
Branch: refs/heads/0.5.0
Commit: 6ea7b07ef541cb1c2359b00d6009fc5b3beb7781
Parents: 129bd9c
Author: Aled Sage <al...@gmail.com>
Authored: Wed Apr 17 14:46:03 2013 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Apr 25 11:25:01 2013 +0100
----------------------------------------------------------------------
.../entity/basic/EntityConfigMapUsageTest.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6ea7b07e/core/src/test/java/brooklyn/entity/basic/EntityConfigMapUsageTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/basic/EntityConfigMapUsageTest.java b/core/src/test/java/brooklyn/entity/basic/EntityConfigMapUsageTest.java
index b5efd58..b2c99a2 100644
--- a/core/src/test/java/brooklyn/entity/basic/EntityConfigMapUsageTest.java
+++ b/core/src/test/java/brooklyn/entity/basic/EntityConfigMapUsageTest.java
@@ -90,6 +90,19 @@ public class EntityConfigMapUsageTest {
}
@Test
+ public void testInheritedConfigAvailableDeepInHierarchy() throws Exception {
+ TestEntity parent = app.createAndManageChild(EntitySpecs.spec(TestEntity.class)
+ .configure(strKeyWithDefault, "customval"));
+ TestEntity entity = parent.createAndManageChild(EntitySpecs.spec(TestEntity.class));
+ TestEntity entity2 = entity.createAndManageChild(EntitySpecs.spec(TestEntity.class));
+ TestEntity entity3 = entity2.createAndManageChild(EntitySpecs.spec(TestEntity.class));
+
+ assertEquals(entity.getConfig(strKeyWithDefault), "customval");
+ assertEquals(entity2.getConfig(strKeyWithDefault), "customval");
+ assertEquals(entity3.getConfig(strKeyWithDefault), "customval");
+ }
+
+ @Test
public void testConfigCanBeSetOnEntity() throws Exception {
TestEntity entity = app.createChild(EntitySpecs.spec(TestEntity.class));
((EntityLocal)entity).setConfig(strKey, "aval");