@Test public void keepAliveTest() { HttpMethod[] HTTP_METHODS = {HttpMethod.POST, HttpMethod.PUT, HttpMethod.GET, HttpMethod.HEAD, HttpMethod.DELETE}; EmbeddedChannel channel = createEmbeddedChannel(); for (HttpMethod httpMethod : HTTP_METHODS) { for (RestServiceErrorCode errorCode : RestServiceErrorCode.values()) { channel = doKeepAliveTest(channel, httpMethod, errorCode, getExpectedHttpResponseStatus(errorCode), 0, null); } channel = doKeepAliveTest(channel, httpMethod, null, HttpResponseStatus.INTERNAL_SERVER_ERROR, 0, null); channel = doKeepAliveTest(channel, httpMethod, null, HttpResponseStatus.INTERNAL_SERVER_ERROR, 0, true); channel = doKeepAliveTest(channel, httpMethod, null, HttpResponseStatus.INTERNAL_SERVER_ERROR, 0, false); } channel = doKeepAliveTest(channel, HttpMethod.PUT, null, HttpResponseStatus.INTERNAL_SERVER_ERROR, 1, null); channel = doKeepAliveTest(channel, HttpMethod.PUT, null, HttpResponseStatus.INTERNAL_SERVER_ERROR, 100, null); channel.close(); }
@Override public void close() { close(new ClosedChannelException()); }
NettyResponseChannel implements RestResponseChannel { @Override public void close() { close(new ClosedChannelException()); } }
NettyResponseChannel implements RestResponseChannel { @Override public void close() { close(new ClosedChannelException()); } NettyResponseChannel(ChannelHandlerContext ctx, NettyMetrics nettyMetrics, PerformanceConfig performanceConfig,
      NettyConfig nettyConfig); }
NettyResponseChannel implements RestResponseChannel { @Override public void close() { close(new ClosedChannelException()); } NettyResponseChannel(ChannelHandlerContext ctx, NettyMetrics nettyMetrics, PerformanceConfig performanceConfig,
      NettyConfig nettyConfig); @Override Future<Long> write(ByteBuffer src, Callback<Long> callback); @Override Future<Long> write(ByteBuf src, Callback<Long> callback); @Override boolean isOpen(); @Override void close(); @Override void onResponseComplete(Exception exception); @Override void setStatus(ResponseStatus status); @Override ResponseStatus getStatus(); @Override void setHeader(String headerName, Object headerValue); @Override Object getHeader(String headerName); }
NettyResponseChannel implements RestResponseChannel { @Override public void close() { close(new ClosedChannelException()); } NettyResponseChannel(ChannelHandlerContext ctx, NettyMetrics nettyMetrics, PerformanceConfig performanceConfig,
      NettyConfig nettyConfig); @Override Future<Long> write(ByteBuffer src, Callback<Long> callback); @Override Future<Long> write(ByteBuf src, Callback<Long> callback); @Override boolean isOpen(); @Override void close(); @Override void onResponseComplete(Exception exception); @Override void setStatus(ResponseStatus status); @Override ResponseStatus getStatus(); @Override void setHeader(String headerName, Object headerValue); @Override Object getHeader(String headerName); final ChannelFutureListener DELAYED_CLOSE; }