brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Tasks stop on unmanaged
Date Thu, 16 Oct 2014 22:09:16 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/252#discussion_r18990314
  
    --- Diff: core/src/test/java/brooklyn/management/ha/HotStandbyTest.java ---
    @@ -560,5 +562,36 @@ public void testChangeMode() throws Exception {
         public void testChangeModeManyTimes() throws Exception {
             testChangeMode();
         }
    +
    +    @Test
    +    public void testChangeModeToDisabledAndBack() throws Exception {
    +        HaMgmtNode n1 = createMaster(Duration.PRACTICALLY_FOREVER);
    +        n1.mgmt.getLocationManager().createLocation(LocationSpec.create(LocalhostMachine.class));
    +        @SuppressWarnings("unused")
    +        TestApplication app = createFirstAppAndPersist(n1);
    +        
    +        HaMgmtNode n2 = createHotStandby(Duration.PRACTICALLY_FOREVER);
    +        
    +        // disabled n1 allows n2 to become master when next we tell it to check
    +        n1.ha.changeMode(HighAvailabilityMode.DISABLED);
    +        n2.ha.changeMode(HighAvailabilityMode.AUTO);
    +        assertMaster(n2);
    +        assertEquals(n1.ha.getNodeState(), ManagementNodeState.FAILED);
    +        Assert.assertTrue(n1.mgmt.getApplications().isEmpty(), "n1 should have had no
apps; instead had: "+n1.mgmt.getApplications());
    +        Assert.assertTrue(n1.mgmt.getEntityManager().getEntities().isEmpty(), "n1 should
have had no entities; instead had: "+n1.mgmt.getEntityManager().getEntities());
    +        Assert.assertTrue(n1.mgmt.getLocationManager().getLocations().isEmpty(), "n1
should have had no locations; instead had: "+n1.mgmt.getLocationManager().getLocations());
    +        
    +        // we can now change n1 back to hot_standby
    +        n1.ha.changeMode(HighAvailabilityMode.HOT_STANDBY);
    +        assertHotStandby(n1);
    +        // and it sees apps
    +        Assert.assertFalse(n1.mgmt.getApplications().isEmpty(), "n1 should have had apps
now");
    +        Assert.assertFalse(n1.mgmt.getApplications().isEmpty(), "n1 should have had locations
now");
    --- End diff --
    
    Should be `n1.mgmt.getLocationManager().getLocations().isEmpty()`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message