@Test(timeout = 60000) public void testBridge() throws Exception { rule.subscriber.unsubscribe(); Mockito.verify(rule.future).addListener(rule.bridge); Mockito.verify(rule.future).removeListener(rule.bridge); }
public void bridge(final ChannelFuture future, Subscriber<?> subscriber) { future.addListener(this); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } })); }
SubscriberToChannelFutureBridge implements ChannelFutureListener { public void bridge(final ChannelFuture future, Subscriber<?> subscriber) { future.addListener(this); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } })); } }
SubscriberToChannelFutureBridge implements ChannelFutureListener { public void bridge(final ChannelFuture future, Subscriber<?> subscriber) { future.addListener(this); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } })); }  }
SubscriberToChannelFutureBridge implements ChannelFutureListener { public void bridge(final ChannelFuture future, Subscriber<?> subscriber) { future.addListener(this); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } })); }  @Override final void operationComplete(ChannelFuture future); void bridge(final ChannelFuture future, Subscriber<?> subscriber); }
SubscriberToChannelFutureBridge implements ChannelFutureListener { public void bridge(final ChannelFuture future, Subscriber<?> subscriber) { future.addListener(this); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } })); }  @Override final void operationComplete(ChannelFuture future); void bridge(final ChannelFuture future, Subscriber<?> subscriber);  }