brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [24/26] git commit: in memento test, supply the lookup context info needed to support policy+enricher rebind, and enable those checks
Date Tue, 10 Jun 2014 02:25:45 GMT
in memento test, supply the lookup context info needed to support policy+enricher rebind, and
enable those checks


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

Branch: refs/heads/master
Commit: eb15d401eb9256c3d7ed677bf0a296ece2957b4f
Parents: 458a117
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Mon Jun 9 19:05:05 2014 -0700
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Mon Jun 9 19:05:05 2014 -0700

----------------------------------------------------------------------
 .../persister/BrooklynMementoPersisterTestFixture.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/eb15d401/core/src/test/java/brooklyn/entity/rebind/persister/BrooklynMementoPersisterTestFixture.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/persister/BrooklynMementoPersisterTestFixture.java
b/core/src/test/java/brooklyn/entity/rebind/persister/BrooklynMementoPersisterTestFixture.java
index 9947e34..b757b17 100644
--- a/core/src/test/java/brooklyn/entity/rebind/persister/BrooklynMementoPersisterTestFixture.java
+++ b/core/src/test/java/brooklyn/entity/rebind/persister/BrooklynMementoPersisterTestFixture.java
@@ -85,7 +85,12 @@ public abstract class BrooklynMementoPersisterTestFixture {
         RebindTestUtils.waitForPersisted(localManagementContext);
         
         RecordingRebindExceptionHandler failFast = new RecordingRebindExceptionHandler(RebindFailureMode.FAIL_FAST,
RebindFailureMode.FAIL_FAST);
-        RebindContextLookupContext lookupContext = new RebindContextLookupContext(new RebindContextImpl(classLoader),
failFast);
+        RebindContextImpl rebindContext = new RebindContextImpl(classLoader);
+        RebindContextLookupContext lookupContext = new RebindContextLookupContext(rebindContext,
failFast);
+        // here we force these two to be reegistered in order to resolve the enricher and
policy
+        // (normally rebind will do that after loading the manifests, but in this test we
are just looking at persistence/manifest)
+        rebindContext.registerEntity(app.getId(), app);
+        rebindContext.registerEntity(entity.getId(), entity);
         
         BrooklynMemento reloadedMemento = persister.loadMemento(lookupContext, failFast);
         return reloadedMemento;
@@ -98,9 +103,8 @@ public abstract class BrooklynMementoPersisterTestFixture {
         assertNotNull(reloadedMemento);
         assertTrue(Iterables.contains(reloadedMemento.getEntityIds(), entity.getId()));
         assertEquals(Iterables.getOnlyElement(reloadedMemento.getLocationIds()), location.getId());
-        // FIXME when policies and enrichers working, re-enable these.
-//        assertEquals(Iterables.getOnlyElement(reloadedMemento.getPolicyIds()), policy.getId());
-//        assertEquals(Iterables.getOnlyElement(reloadedMemento.getEnricherIds()), enricher.getId());
+        assertEquals(Iterables.getOnlyElement(reloadedMemento.getPolicyIds()), policy.getId());
+        assertEquals(Iterables.getOnlyElement(reloadedMemento.getEnricherIds()), enricher.getId());
     }
 
     @Test


Mime
View raw message