@Test public void shouldPropagateUpstreamOpenOnBarrierFutureSuccess() throws Exception { context.checking(new Expectations() { { oneOf(upstream).handleUpstream(with(any(ChannelHandlerContext.class)), with(any(PreparationEvent.class))); oneOf(upstream).handleUpstream(with(any(ChannelHandlerContext.class)), with(channelState(OPEN, TRUE))); } }); channelFactory.newChannel(pipeline); ChannelFuture barrierFuture = barrier.getFuture(); barrierFuture.setSuccess(); ChannelFuture handlerFuture = handler.getHandlerFuture(); assertTrue(handlerFuture.isSuccess()); assertFalse(handler.hasQueuedChannelEvents()); context.assertIsSatisfied(); }
boolean hasQueuedChannelEvents() { return queue != null && !queue.isEmpty(); }
AwaitBarrierUpstreamHandler extends AbstractBarrierHandler implements ChannelUpstreamHandler { boolean hasQueuedChannelEvents() { return queue != null && !queue.isEmpty(); } }
AwaitBarrierUpstreamHandler extends AbstractBarrierHandler implements ChannelUpstreamHandler { boolean hasQueuedChannelEvents() { return queue != null && !queue.isEmpty(); } AwaitBarrierUpstreamHandler(Barrier barrier); }
AwaitBarrierUpstreamHandler extends AbstractBarrierHandler implements ChannelUpstreamHandler { boolean hasQueuedChannelEvents() { return queue != null && !queue.isEmpty(); } AwaitBarrierUpstreamHandler(Barrier barrier); @Override void prepareRequested(final ChannelHandlerContext ctx, PreparationEvent evt); }
AwaitBarrierUpstreamHandler extends AbstractBarrierHandler implements ChannelUpstreamHandler { boolean hasQueuedChannelEvents() { return queue != null && !queue.isEmpty(); } AwaitBarrierUpstreamHandler(Barrier barrier); @Override void prepareRequested(final ChannelHandlerContext ctx, PreparationEvent evt);  }