brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [7/8] git commit: PR #1415 policy persistence: incorporate review comments
Date Tue, 27 May 2014 21:35:19 GMT
PR #1415 policy persistence: incorporate review comments


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

Branch: refs/heads/master
Commit: afe2c673e17f4b33cb9c686b60b59e173eb9cf72
Parents: e1b08d5
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue May 27 20:34:13 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue May 27 20:50:56 2014 +0100

----------------------------------------------------------------------
 .../java/brooklyn/entity/group/MembershipTrackingPolicyTest.java | 4 ++--
 .../src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java | 2 +-
 core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java  | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afe2c673/core/src/test/java/brooklyn/entity/group/MembershipTrackingPolicyTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/group/MembershipTrackingPolicyTest.java b/core/src/test/java/brooklyn/entity/group/MembershipTrackingPolicyTest.java
index fba8549..cedaf2b 100644
--- a/core/src/test/java/brooklyn/entity/group/MembershipTrackingPolicyTest.java
+++ b/core/src/test/java/brooklyn/entity/group/MembershipTrackingPolicyTest.java
@@ -155,7 +155,7 @@ public class MembershipTrackingPolicyTest {
         RecordingMembershipTrackingPolicy nonDuplicateTrackingPolicy = app.addPolicy(PolicySpec.create(RecordingMembershipTrackingPolicy.class)
                 .configure(AbstractMembershipTrackingPolicy.SENSORS_TO_TRACK, ImmutableSet.<Sensor<?>>of(TestEntity.NAME))
                 .configure(AbstractMembershipTrackingPolicy.NOTIFY_ON_DUPLICATES, false)
-                .configure("group", group));
+                .configure(AbstractMembershipTrackingPolicy.GROUP, group));
 
         e1.setAttribute(TestEntity.NAME, "myname");
 
@@ -177,7 +177,7 @@ public class MembershipTrackingPolicyTest {
         
         RecordingMembershipTrackingPolicy nonDuplicateTrackingPolicy = app.addPolicy(PolicySpec.create(RecordingMembershipTrackingPolicy.class)
                 .configure(AbstractMembershipTrackingPolicy.SENSORS_TO_TRACK, ImmutableSet.<Sensor<?>>of(TestEntity.NAME))
-                .configure("group", group));
+                .configure(AbstractMembershipTrackingPolicy.GROUP, group));
 
         e1.setAttribute(TestEntity.NAME, "myname");
         assertRecordsEventually(nonDuplicateTrackingPolicy, Record.newAdded(e1), Record.newChanged(e1));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afe2c673/core/src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java b/core/src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java
index 6d0640c..3cfd54c 100644
--- a/core/src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/RebindEnricherTest.java
@@ -107,7 +107,7 @@ public class RebindEnricherTest extends RebindTestFixtureWithApp {
         TestApplication newApp = rebind();
         DynamicCluster newCluster = (DynamicCluster) Iterables.find(newApp.getChildren(),
Predicates.instanceOf(DynamicCluster.class));
 
-        int i = 0;
+        int i = 1;
         for (Entity member : newCluster.getMembers()) {
             ((EntityInternal)member).setAttribute(METRIC1, "myval"+(i++));
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/afe2c673/core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java b/core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java
index 5db6d03..929536e 100644
--- a/core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/RebindPolicyTest.java
@@ -32,7 +32,7 @@ public class RebindPolicyTest extends RebindTestFixtureWithApp {
     
     @Test(enabled=false)
     public void testRestoresSimplePolicyFromConstructor() throws Exception {
-        MyPolicy origPolicy = new MyPolicy(MutableMap.of("myfield", "myval", "myconfigkey",
"myConfigVal"));
+        MyPolicy origPolicy = new MyPolicy(MutableMap.of("myfield", "myFieldVal", "myconfigkey",
"myConfigVal"));
         origApp.addPolicy(origPolicy);
     }
 
@@ -53,7 +53,7 @@ public class RebindPolicyTest extends RebindTestFixtureWithApp {
         MyPolicy newPolicy = (MyPolicy) Iterables.getOnlyElement(newApp.getPolicies());
         
         assertEquals(newPolicy.myfield, "myFieldVal");
-        assertEquals(newPolicy.myfield, "myConfigVal");
+        assertEquals(newPolicy.getConfig(MyPolicy.MY_CONFIG), "myConfigVal");
         assertTrue(newPolicy.isRunning());
         assertFalse(origPolicy.initCalled);
         assertTrue(origPolicy.rebindCalled);


Mime
View raw message