}
}
public void testConnectionRecoveryWithDisabledTopologyRecovery() throws IOException, InterruptedException {
AutorecoveringConnection c = newRecoveringConnection(true);
Channel ch = c.createChannel();
String q = "java-client.test.recovery.q2";
ch.queueDeclare(q, false, true, false, null);
ch.queueDeclarePassive(q);
assertTrue(c.isOpen());
try {
CountDownLatch shutdownLatch = prepareForShutdown(c);
CountDownLatch recoveryLatch = prepareForRecovery(c);
Host.closeConnection(c);
wait(shutdownLatch);
wait(recoveryLatch);
assertTrue(c.isOpen());
ch.queueDeclarePassive(q);
fail("expected passive declaration to throw");
} catch (java.io.IOException e) {
// expected
} finally {
c.abort();
}
}