@Test
public void testRoundRobinOneActiveSink() throws Exception {

  Channel ch = new MockChannel();
  int n = 10;
  int numEvents = n;
  for (int i = 0; i < numEvents; i++) {
    ch.put(new MockEvent("test" + i));
  }
  MockSink s1 = new MockSink(1);
  s1.setChannel(ch);
  // s1 always fails
  s1.setFail(true);
  MockSink s2 = new MockSink(2);
  s2.setChannel(ch);
  MockSink s3 = new MockSink(3);
  s3.setChannel(ch);
  // s3 always fails
  s3.setFail(true);
  List<Sink> sinks = new ArrayList<Sink>();
  sinks.add(s1);
  sinks.add(s2);
  sinks.add(s3);
  LoadBalancingSinkProcessor lbsp = getProcessor("round_robin", sinks, false);
  Sink.Status s = Sink.Status.READY;
  while (s != Sink.Status.BACKOFF) {
    s = lbsp.process();
  }
  Assert.assertTrue(s1.getEvents().size() == 0);
  Assert.assertTrue(s2.getEvents().size() == n);
  Assert.assertTrue(s3.getEvents().size() == 0);
}