@Test public void channelInactiveHappensAfterExceptionCaughtEvents() throws Exception { final AtomicInteger count = new AtomicInteger(0); final AtomicInteger exceptionCaught = new AtomicInteger(-1); final AtomicInteger channelInactive = new AtomicInteger(-1); final AtomicInteger channelUnregistered = new AtomicInteger(-1); Http2StreamChannel childChannel = newOutboundStream(); childChannel.pipeline().addLast(new ChannelInboundHandlerAdapter() { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { ctx.close(); throw new Exception("exception"); } }); childChannel.pipeline().addLast(new ChannelInboundHandlerAdapter() { @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { channelInactive.set(count.getAndIncrement()); super.channelInactive(ctx); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { exceptionCaught.set(count.getAndIncrement()); super.exceptionCaught(ctx, cause); } @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { channelUnregistered.set(count.getAndIncrement()); super.channelUnregistered(ctx); } }); childChannel.pipeline().fireUserEventTriggered(new Object()); parentChannel.runPendingTasks(); assertEquals(0, exceptionCaught.get()); assertEquals(1, channelInactive.get()); assertEquals(2, channelUnregistered.get()); }
final Http2StreamChannel newOutboundStream() { return new DefaultHttp2StreamChannel(newStream(), true); }
Http2MultiplexCodec extends Http2FrameCodec { final Http2StreamChannel newOutboundStream() { return new DefaultHttp2StreamChannel(newStream(), true); } }
Http2MultiplexCodec extends Http2FrameCodec { final Http2StreamChannel newOutboundStream() { return new DefaultHttp2StreamChannel(newStream(), true); } Http2MultiplexCodec(Http2ConnectionEncoder encoder,
                        Http2ConnectionDecoder decoder,
                        Http2Settings initialSettings,
                        ChannelHandler inboundStreamHandler,
                        ChannelHandler upgradeStreamHandler); }
Http2MultiplexCodec extends Http2FrameCodec { final Http2StreamChannel newOutboundStream() { return new DefaultHttp2StreamChannel(newStream(), true); } Http2MultiplexCodec(Http2ConnectionEncoder encoder,
                        Http2ConnectionDecoder decoder,
                        Http2Settings initialSettings,
                        ChannelHandler inboundStreamHandler,
                        ChannelHandler upgradeStreamHandler); @Override void onHttpClientUpgrade(); @Override final void handlerAdded0(ChannelHandlerContext ctx); @Override final void handlerRemoved0(ChannelHandlerContext ctx); @Override final void channelReadComplete(ChannelHandlerContext ctx); @Override final void channelRead(ChannelHandlerContext ctx, Object msg); }
Http2MultiplexCodec extends Http2FrameCodec { final Http2StreamChannel newOutboundStream() { return new DefaultHttp2StreamChannel(newStream(), true); } Http2MultiplexCodec(Http2ConnectionEncoder encoder,
                        Http2ConnectionDecoder decoder,
                        Http2Settings initialSettings,
                        ChannelHandler inboundStreamHandler,
                        ChannelHandler upgradeStreamHandler); @Override void onHttpClientUpgrade(); @Override final void handlerAdded0(ChannelHandlerContext ctx); @Override final void handlerRemoved0(ChannelHandlerContext ctx); @Override final void channelReadComplete(ChannelHandlerContext ctx); @Override final void channelRead(ChannelHandlerContext ctx, Object msg);  }