Search in sources :

Example 1 with NetworkSender

use of org.komamitsu.fluency.sender.NetworkSender in project fluency by komamitsu.

the class FluencyTest method assertDefaultSender.

private void assertDefaultSender(Sender sender, String expectedHost, int expectedPort, Class<? extends NetworkSender> expectedBaseClass) {
    assertThat(sender, instanceOf(RetryableSender.class));
    RetryableSender retryableSender = (RetryableSender) sender;
    assertDefaultRetryableSender(retryableSender, expectedBaseClass);
    NetworkSender networkSender = (NetworkSender) retryableSender.getBaseSender();
    assertThat(networkSender.getHost(), is(expectedHost));
    assertThat(networkSender.getPort(), is(expectedPort));
    assertThat(networkSender.getConnectionTimeoutMilli(), is(5000));
    assertThat(networkSender.getReadTimeoutMilli(), is(5000));
    FailureDetector failureDetector = networkSender.getFailureDetector();
    assertThat(failureDetector, is(nullValue()));
}
Also used : FailureDetector(org.komamitsu.fluency.sender.failuredetect.FailureDetector) NetworkSender(org.komamitsu.fluency.sender.NetworkSender) RetryableSender(org.komamitsu.fluency.sender.RetryableSender)

Aggregations

NetworkSender (org.komamitsu.fluency.sender.NetworkSender)1 RetryableSender (org.komamitsu.fluency.sender.RetryableSender)1 FailureDetector (org.komamitsu.fluency.sender.failuredetect.FailureDetector)1