@Test(timeOut = 3_000L)
public void testBasicBehaviour () {
final AtomicInteger messages = new AtomicInteger ();
final FunctionInvocationStatisticsSender sender = new FunctionInvocationStatisticsSender ();
final FunctionInvocationStatisticsReceiver receiver = new FunctionInvocationStatisticsReceiver (_cost);
sender.setExecutorService(Executors.newCachedThreadPool ());
sender.setFudgeMessageSender(new FudgeMessageSender () {
@Override
public FudgeContext getFudgeContext() {
return FudgeContext.GLOBAL_DEFAULT;
}
@Override
public void send(final FudgeMsg message) {
messages.incrementAndGet ();
s_logger.debug ("Received {}", message);
receiver.messageReceived(getFudgeContext (), new FudgeMsgEnvelope (message));
}
});
sender.setUpdatePeriod(Duration.ofSeconds(1));
long t = System.nanoTime ();