You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2017/11/06 11:24:21 UTC

[1/3] brooklyn-server git commit: Stop memberSpecs being inherited

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 48f090071 -> aa43a5feb


Stop memberSpecs being inherited


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

Branch: refs/heads/master
Commit: 09b9cda37f92a62216ac69ac6c30b178e522a104
Parents: 84e9e19
Author: Duncan Godwin <du...@cloudsoftcorp.com>
Authored: Fri Nov 3 11:46:18 2017 +0000
Committer: Duncan Godwin <du...@cloudsoftcorp.com>
Committed: Fri Nov 3 11:48:01 2017 +0000

----------------------------------------------------------------------
 .../brooklyn/entity/group/DynamicCluster.java    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/09b9cda3/core/src/main/java/org/apache/brooklyn/entity/group/DynamicCluster.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/entity/group/DynamicCluster.java b/core/src/main/java/org/apache/brooklyn/entity/group/DynamicCluster.java
index 2be07b0..417a014 100644
--- a/core/src/main/java/org/apache/brooklyn/entity/group/DynamicCluster.java
+++ b/core/src/main/java/org/apache/brooklyn/entity/group/DynamicCluster.java
@@ -35,6 +35,7 @@ import org.apache.brooklyn.api.sensor.AttributeSensor;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.annotation.Effector;
 import org.apache.brooklyn.core.annotation.EffectorParam;
+import org.apache.brooklyn.core.config.BasicConfigInheritance;
 import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.effector.MethodEffector;
 import org.apache.brooklyn.core.entity.Attributes;
@@ -138,16 +139,18 @@ public interface DynamicCluster extends AbstractGroup, Cluster, MemberReplaceabl
 
     @CatalogConfig(label = "Member spec")
     @SetFromFlag("memberSpec")
-    ConfigKey<EntitySpec<?>> MEMBER_SPEC = ConfigKeys.newConfigKey(
-            new TypeToken<EntitySpec<?>>() { },
-            "dynamiccluster.memberspec", "entity spec for creating new cluster members", null);
+    ConfigKey<EntitySpec<?>> MEMBER_SPEC = ConfigKeys.builder(new TypeToken<EntitySpec<?>>(){}, "dynamiccluster.memberspec")
+            .description("entity spec for creating new cluster members")
+            .defaultValue(null)
+            .runtimeInheritance(BasicConfigInheritance.NOT_REINHERITED)
+            .build();
 
     @SetFromFlag("firstMemberSpec")
-    ConfigKey<EntitySpec<?>> FIRST_MEMBER_SPEC = ConfigKeys.newConfigKey(
-            new TypeToken<EntitySpec<?>>() { },
-            "dynamiccluster.firstmemberspec", 
-            "entity spec for creating the first member of the cluster (if unset, will use the member spec for all)", 
-            null);
+    ConfigKey<EntitySpec<?>> FIRST_MEMBER_SPEC = ConfigKeys.builder(new TypeToken<EntitySpec<?>>(){}, "dynamiccluster.firstmemberspec")
+            .description("entity spec for creating the first member of the cluster (if unset, will use the member spec for all)")
+            .defaultValue(null)
+            .runtimeInheritance(BasicConfigInheritance.NOT_REINHERITED)
+            .build();
 
     @SetFromFlag("removalStrategy")
     ConfigKey<Function<Collection<Entity>, Entity>> REMOVAL_STRATEGY = ConfigKeys.newConfigKey(


[3/3] brooklyn-server git commit: This closes #876

Posted by al...@apache.org.
This closes #876


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

Branch: refs/heads/master
Commit: aa43a5feb0ae331174a8292712c9ae5358772bcf
Parents: 48f0900 2d14f64
Author: Aled Sage <al...@gmail.com>
Authored: Mon Nov 6 11:24:06 2017 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Nov 6 11:24:06 2017 +0000

----------------------------------------------------------------------
 .../brooklyn/entity/group/DynamicCluster.java   | 19 +++++++++++--------
 .../entity/group/DynamicClusterTest.java        | 20 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/aa43a5fe/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
----------------------------------------------------------------------


[2/3] brooklyn-server git commit: Add test

Posted by al...@apache.org.
Add test


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

Branch: refs/heads/master
Commit: 2d14f6406ad6fe60ff29ed50b527095426077df1
Parents: 09b9cda
Author: Duncan Godwin <du...@cloudsoftcorp.com>
Authored: Fri Nov 3 14:01:38 2017 +0000
Committer: Duncan Godwin <du...@cloudsoftcorp.com>
Committed: Fri Nov 3 14:03:10 2017 +0000

----------------------------------------------------------------------
 .../entity/group/DynamicClusterTest.java        | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2d14f640/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java b/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
index 0827664..03a4a64 100644
--- a/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
+++ b/core/src/test/java/org/apache/brooklyn/entity/group/DynamicClusterTest.java
@@ -171,6 +171,26 @@ public class DynamicClusterTest extends AbstractDynamicClusterOrFabricTest {
     }
 
     @Test
+    public void testMemberSpecNotInherited() throws Exception {
+        DynamicCluster cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
+                .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TestEntity.class)));
+        DynamicCluster child = cluster.addChild(EntitySpec.create(DynamicCluster.class));
+        Asserts.assertNull(child.getConfig(DynamicCluster.MEMBER_SPEC));
+        DynamicCluster memberChild = cluster.addMemberChild(EntitySpec.create(DynamicCluster.class));
+        Asserts.assertNull(memberChild.getConfig(DynamicCluster.MEMBER_SPEC));
+    }
+
+    @Test
+    public void testFirstMemberSpecNotInherited() throws Exception {
+        DynamicCluster cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
+                .configure(DynamicCluster.FIRST_MEMBER_SPEC, EntitySpec.create(TestEntity.class)));
+        DynamicCluster child = cluster.addChild(EntitySpec.create(DynamicCluster.class));
+        Asserts.assertNull(child.getConfig(DynamicCluster.FIRST_MEMBER_SPEC));
+        DynamicCluster memberChild = cluster.addMemberChild(EntitySpec.create(DynamicCluster.class));
+        Asserts.assertNull(memberChild.getConfig(DynamicCluster.FIRST_MEMBER_SPEC));
+    }
+
+    @Test
     public void testClusterHasOneLocationAfterStarting() throws Exception {
         DynamicCluster cluster = app.createAndManageChild(EntitySpec.create(DynamicCluster.class)
                 .configure(DynamicCluster.MEMBER_SPEC, EntitySpec.create(TestEntity.class)));