@Test
public void testBlockUntilActive() throws IOException, KeeperException, InterruptedException {
// the first server, expect to be active master
HostPort hostPort1 = new HostPort("127.0.0.1", 11111);
FailoverWatcher failoverWatcher1 = createFailoverWatcher(hostPort1);
failoverWatcher1.blockUntilActive();
assertTrue(failoverWatcher1.hasActiveServer());
String activeServer = new String(ZooKeeperUtil.getDataAndWatch(failoverWatcher1,
failoverWatcher1.masterZnode));
assertTrue(activeServer.equals(hostPort1.getHostPort()));