From 3373f83cbbdf86c3e6518f275e964de5f3b3f232 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 13 Jan 2014 23:25:32 +0900 Subject: [PATCH] Fix a bug where DefaultChannelPipelineTest.testFireChannelRegistered() triggers channelRegistered() twice --- .../java/io/netty/channel/DefaultChannelPipelineTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java index 271b87d0f6..ea22c0a41b 100644 --- a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java +++ b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java @@ -190,9 +190,8 @@ public class DefaultChannelPipelineTest { @Test public void testFireChannelRegistered() throws Exception { - ChannelPipeline pipeline = new LocalChannel().pipeline(); - group.register(pipeline.channel()); final CountDownLatch latch = new CountDownLatch(1); + ChannelPipeline pipeline = new LocalChannel().pipeline(); pipeline.addLast(new ChannelInitializer() { @Override protected void initChannel(Channel ch) throws Exception { @@ -204,7 +203,7 @@ public class DefaultChannelPipelineTest { }); } }); - pipeline.fireChannelRegistered(); + group.register(pipeline.channel()); assertTrue(latch.await(2, TimeUnit.SECONDS)); }