final HttpResponse response = ch.readOutbound();
assertThat(response.getStatus(), equalTo(HttpResponseStatus.OK));
//Read and discard prelude
ch.readOutbound();
final DefaultHttpContent openResponse = ch.readOutbound();
assertThat(openResponse.content().toString(UTF_8), equalTo("o\n"));
final EmbeddedChannel ch2 = channelForService(echoFactory);
removeLastInboundMessageHandlers(ch2);
final FullHttpRequest request2 = httpRequest(sessionUrl + Transports.Type.XHR_STREAMING.path(), GET);
ch2.writeInbound(request2);
final HttpResponse response2 = ch2.readOutbound();
assertThat(response2.getStatus(), equalTo(HttpResponseStatus.OK));
//Read and discard prelude
ch2.readOutbound();
final DefaultHttpContent closeResponse2 = ch2.readOutbound();
assertThat(closeResponse2.content().toString(UTF_8), equalTo("c[2010,\"Another connection still open\"]\n"));
assertThat(ch2.isActive(), is(false));
ch.close();
final EmbeddedChannel ch3 = channelForService(echoFactory);
removeLastInboundMessageHandlers(ch3);
final FullHttpRequest request3 = httpRequest(sessionUrl + Transports.Type.XHR_STREAMING.path(), POST);
ch3.writeInbound(request3);
final HttpResponse response3 = ch3.readOutbound();
assertThat(response3.getStatus(), equalTo(HttpResponseStatus.OK));
//Read and discard prelude
ch3.readOutbound();
final DefaultHttpContent closeResponse3 = ch3.readOutbound();
assertThat(closeResponse3.content().toString(UTF_8), equalTo("c[1002,\"Connection interrupted\"]\n"));
assertThat(ch3.isActive(), is(false));
ch.close();
}