ARTEMIS-105 forceFailover always throws exception

This commit is contained in:
jbertram 2015-06-24 09:01:07 -05:00
parent c6cba40888
commit 7c066c0ee4
3 changed files with 10 additions and 8 deletions

View File

@ -1928,15 +1928,8 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
clearIO(); clearIO();
try
{
server.stop(true); server.stop(true);
} }
finally
{
blockOnIO();
}
}
@Override @Override
public void updateDuplicateIdCache(String address, Object[] ids) throws Exception public void updateDuplicateIdCache(String address, Object[] ids) throws Exception

View File

@ -753,6 +753,7 @@ public class ActiveMQServerImpl implements ActiveMQServer
messagingServerControl = null; messagingServerControl = null;
memoryManager = null; memoryManager = null;
backupManager = null; backupManager = null;
storageManager = null;
sessions.clear(); 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 protected void scaleDown(ScaleDownHandler handler) throws Exception
{ {
SimpleString address = new SimpleString("testQueue"); SimpleString address = new SimpleString("testQueue");