@Test public void closeTest() { HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.Close.toString()); EmbeddedChannel channel = createEmbeddedChannel(); channel.writeInbound(request); HttpResponse response = (HttpResponse) channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.INTERNAL_SERVER_ERROR, response.status()); assertFalse("Inconsistent value for Connection header", HttpUtil.isKeepAlive(response)); while (channel.readOutbound() != null) { } assertFalse("Channel should be closed", channel.isOpen()); }
@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; }