}
@Test public void testFailover() throws Exception {
SSLConfiguration config = new SSLConfiguration();
Properties p = new Properties();
SocketServerConnection conn = helpEstablishConnection(false, config, p);
assertTrue(conn.isOpen(1000));
//restart the second instance now that we know the connection was made to the first
listener1 = createListener(new InetSocketAddress(addr.getAddress(), listener1.getPort()), config);
listener.stop();
conn.isOpen(1000); //there is a chance this call can fail
assertTrue(conn.isOpen(1000));
listener1.stop();
//both instances are down
assertFalse(conn.isOpen(1000));
//bring the first back up
listener = createListener(new InetSocketAddress(addr.getAddress(), listener.getPort()), config);
assertTrue(conn.isOpen(1000));
assertEquals(3, logonAttempts);
conn.close();
}