This closes #48 forceFailover method

This commit is contained in:
Clebert Suconic 2015-06-24 13:54:32 -04:00
commit 6babfee36a
3 changed files with 10 additions and 8 deletions

View File

@ -1928,14 +1928,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
clearIO();
try
{
server.stop(true);
}
finally
{
blockOnIO();
}
server.stop(true);
}
@Override

View File

@ -753,6 +753,7 @@ public class ActiveMQServerImpl implements ActiveMQServer
messagingServerControl = null;
memoryManager = null;
backupManager = null;
storageManager = null;
sessions.clear();

View File

@ -1019,6 +1019,14 @@ public class ActiveMQServerControlTest extends ManagementTestBase
});
}
@Test
public void testForceFailover() throws Exception
{
ActiveMQServerControl serverControl = createManagementControl();
serverControl.forceFailover();
assertFalse(server.isStarted());
}
protected void scaleDown(ScaleDownHandler handler) throws Exception
{
SimpleString address = new SimpleString("testQueue");