@Test public void testSourceCounterReadFail() throws Exception { init("true"); ChannelProcessor cp = Mockito.mock(ChannelProcessor.class); doThrow(new RuntimeException("dummy")).when(cp).processEvent(any(Event.class)); source.setChannelProcessor(cp); doCounterCommon(); for (int i = 0; i < 10 && source.getSourceCounter().getEventReadFail() == 0; i++) { Thread.sleep(100); } Assert.assertEquals(1, source.getSourceCounter().getEventReadFail()); }
@VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; }
SyslogUDPSource extends AbstractSource implements EventDrivenSource, Configurable { @VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; } }
SyslogUDPSource extends AbstractSource implements EventDrivenSource, Configurable { @VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; }  }
SyslogUDPSource extends AbstractSource implements EventDrivenSource, Configurable { @VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; }  @Override void start(); @Override void stop(); @Override void configure(Context context); }
SyslogUDPSource extends AbstractSource implements EventDrivenSource, Configurable { @VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; }  @Override void start(); @Override void stop(); @Override void configure(Context context); static final int DEFAULT_MIN_SIZE; static final int DEFAULT_INITIAL_SIZE; }