From 2e1325aa9de21b7fd10f2ac56b49fd5a3bbaa189 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 14 Apr 2015 14:15:46 +0200 Subject: [PATCH] Revert "Add another test case for channelReadComplete() suppression" This reverts commit 5fca3de09869b168586b6ab6fc3e2d05b2b9ecba. --- .../channel/DefaultChannelPipelineTest.java | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java index 326c003b29..93ec1ad18c 100644 --- a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java +++ b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java @@ -621,44 +621,6 @@ public class DefaultChannelPipelineTest { } } - /** - * {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext)} should not be suppressed - * when a handler has just been added and thus had no chance to get the previous - * {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)}. - */ - @Test - public void testProhibitChannelReadCompleteSuppression() throws Exception { - final AtomicInteger readComplete = new AtomicInteger(); - - EmbeddedChannel ch = new EmbeddedChannel(new ChannelInboundHandlerAdapter() { - @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { - ctx.fireChannelRead(msg); - - // Add a new handler *after* channelRead() is triggered, so that - // the new handler does not handle channelRead() at all. - ctx.pipeline().addAfter(ctx.name(), "newHandler", new ChannelInboundHandlerAdapter() { - @Override - public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { - readComplete.incrementAndGet(); - } - }); - } - - @Override - public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { - ctx.fireChannelReadComplete(); - } - }); - - ChannelPipeline p = ch.pipeline(); - p.fireChannelRead(Boolean.TRUE); - p.fireChannelReadComplete(); - ch.finish(); - - assertEquals(1, readComplete.get()); - } - @Test public void testChannelReadTriggered() { final AtomicInteger read1 = new AtomicInteger();