Fix integration test in RebindLocalhostLocationTest

(See the existing TODO in the code)

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

Branch: refs/heads/master
Commit: ff38a5c80c0d77b81316623d749b76bf3dd1a78e
Parents: 9539ccf
Author: Aled Sage <aled.s...@gmail.com>
Authored: Wed May 23 10:46:21 2018 +0100
Committer: Aled Sage <aled.s...@gmail.com>
Committed: Thu May 24 12:24:13 2018 +0100

----------------------------------------------------------------------
 .../core/mgmt/rebind/RebindLocalhostLocationTest.java     | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ff38a5c8/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindLocalhostLocationTest.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindLocalhostLocationTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindLocalhostLocationTest.java
index 381ec48..5bc6cc2 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindLocalhostLocationTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindLocalhostLocationTest.java
@@ -29,7 +29,6 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.mgmt.rebind.mementos.BrooklynMementoManifest;
-import org.apache.brooklyn.core.test.entity.TestApplication;
 import 
org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
 
@@ -87,19 +86,18 @@ public class RebindLocalhostLocationTest extends 
RebindTestFixtureWithApp {
         testMachineUsableAfterRebind();
         newApp.stop();
 
-        switchOriginalToNewManagementContext();
-        
         // TODO how should we automatically unmanage these?
         // (in this test, locations are created manually, so probably should 
be destroyed manually, 
         // but in most cases we should probably unmanage the location as part 
of the entity;
         // could keep the entity ID only in the location, then safely 
reverse-check usages?)
         // see related non-integration test in RebindEntityTest
-        origManagementContext.getLocationManager().unmanage(origLoc);
+        newManagementContext.getLocationManager().unmanage(origLoc);
         
-        RebindTestUtils.waitForPersisted(origManagementContext);
+        RebindTestUtils.waitForPersisted(newManagementContext);
+        
+        switchOriginalToNewManagementContext();
         
         BrooklynMementoManifest mf = loadMementoManifest();
         Assert.assertTrue(mf.getLocationIdToType().isEmpty(), "Expected no 
locations; had "+mf.getLocationIdToType());
     }
-    
 }

Reply via email to