@Test
public void testClientCanNegotiateTransportWithServerNotSupportingWebSocket() throws Exception
{
bayeux.setAllowedTransports("long-polling");
final ClientTransport webSocketTransport = newWebSocketTransport(null);
final ClientTransport longPollingTransport = newLongPollingTransport(null);
final CountDownLatch failureLatch = new CountDownLatch(1);
final BayeuxClient client = new BayeuxClient(cometdURL, webSocketTransport, longPollingTransport)
{
@Override
protected void onTransportFailure(String oldTransportName, String newTransportName, Throwable failure)
{
Assert.assertEquals(webSocketTransport.getName(), oldTransportName);
Assert.assertEquals(longPollingTransport.getName(), newTransportName);
failureLatch.countDown();
}
};
final CountDownLatch successLatch = new CountDownLatch(1);