Fix a bug where DefaultChannelPipelineTest.testFireChannelRegistered() triggers channelRegistered() twice
This commit is contained in:
parent
febc53daaa
commit
3373f83cbb
@ -190,9 +190,8 @@ public class DefaultChannelPipelineTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFireChannelRegistered() throws Exception {
|
public void testFireChannelRegistered() throws Exception {
|
||||||
ChannelPipeline pipeline = new LocalChannel().pipeline();
|
|
||||||
group.register(pipeline.channel());
|
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
|
ChannelPipeline pipeline = new LocalChannel().pipeline();
|
||||||
pipeline.addLast(new ChannelInitializer<Channel>() {
|
pipeline.addLast(new ChannelInitializer<Channel>() {
|
||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel ch) throws Exception {
|
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));
|
assertTrue(latch.await(2, TimeUnit.SECONDS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user