SyslogTcpSource extends SslContextAwareAbstractSource implements EventDrivenSource, Configurable { @VisibleForTesting SourceCounter getSourceCounter() { return sourceCounter; }  @Override void start(); @Override void stop(); @Override void configure(Context context);  }
@Test public void testSourceCounter() throws IOException { runKeepFieldsTest("all"); assertEquals(10, source.getSourceCounter().getEventAcceptedCount()); assertEquals(10, source.getSourceCounter().getEventReceivedCount()); }
@Test public void testSourceCounterChannelFail() throws Exception { init("true"); errorCounterCommon(new ChannelException("dummy")); for (int i = 0; i < 10 && source.getSourceCounter().getChannelWriteFail() == 0; i++) { Thread.sleep(100); } assertEquals(1, source.getSourceCounter().getChannelWriteFail()); }
@Test public void testSourceCounterEventFail() throws Exception { init("true"); errorCounterCommon(new RuntimeException("dummy")); for (int i = 0; i < 10 && source.getSourceCounter().getEventReadFail() == 0; i++) { Thread.sleep(100); } assertEquals(1, source.getSourceCounter().getEventReadFail()); }