*/
@Test
public void webSocketHixie76TestReuseSessionId() throws Exception {
final SockJsServiceFactory echoFactory = echoService();
final String sessionUrl = echoFactory.config().prefix() + "/222/" + UUID.randomUUID().toString();
final EmbeddedChannel ch1 = wsChannelForService(echoFactory);
final EmbeddedChannel ch2 = wsChannelForService(echoFactory);
ch1.writeInbound(webSocketUpgradeRequest(sessionUrl + "/websocket", WebSocketVersion.V00));
final FullHttpResponse upgradeResponse = HttpUtil.decodeFullHttpResponse(ch1);
assertThat(upgradeResponse.content().toString(UTF_8), equalTo("8jKS'y:G*Co,Wxa-"));
ch2.writeInbound(webSocketUpgradeRequest(sessionUrl + "/websocket", WebSocketVersion.V00));
final FullHttpResponse upgradeResponse2 = HttpUtil.decodeFullHttpResponse(ch2);
assertThat(upgradeResponse2.content().toString(UTF_8), equalTo("8jKS'y:G*Co,Wxa-"));
assertThat(((ByteBufHolder) ch1.readOutbound()).content().toString(UTF_8), equalTo("o"));
assertThat(((ByteBufHolder) ch2.readOutbound()).content().toString(UTF_8), equalTo("o"));
ch1.writeInbound(new TextWebSocketFrame("\"a\""));
assertThat(((ByteBufHolder) ch1.readOutbound()).content().toString(UTF_8), equalTo("a[\"a\"]"));
ch2.writeInbound(new TextWebSocketFrame("\"b\""));
assertThat(((ByteBufHolder) ch2.readOutbound()).content().toString(UTF_8), equalTo("a[\"b\"]"));
ch1.close();
ch2.close();
final EmbeddedChannel newCh = wsChannelForService(echoFactory);
newCh.writeInbound(webSocketUpgradeRequest(sessionUrl + "/websocket"));
final FullHttpResponse upgradeResponse3 = HttpUtil.decodeFullHttpResponse(newCh);
assertThat(upgradeResponse3.getStatus(), equalTo(HttpResponseStatus.SWITCHING_PROTOCOLS));
assertThat(((ByteBufHolder) readOutboundDiscardEmpty(newCh)).content().toString(UTF_8), equalTo("o"));
newCh.writeInbound(new TextWebSocketFrame("\"a\""));
assertThat(((ByteBufHolder) newCh.readOutbound()).content().toString(UTF_8), equalTo("a[\"a\"]"));
newCh.close();
}