LoggingOutInterceptor out = new LoggingOutInterceptor();
bus.getOutInterceptors().add(out);
// an interceptor to simulate a message loss
MessageLossSimulator mls = new MessageLossSimulator();
bus.getOutInterceptors().add(mls);
RMManager manager = bus.getExtension(RMManager.class);
manager.getRMAssertion().getBaseRetransmissionInterval().setMilliseconds(new Long(2000));
bus.getOutFaultInterceptors().add(out);
GreeterService gs = new GreeterService();
final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, DecoupledClientServerTest.PORT);
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
greeter.greetMeOneWay("one");
greeter.greetMeOneWay("two");
greeter.greetMeOneWay("three");
long wait = 4000;
while (wait > 0) {
long start = System.currentTimeMillis();
try {
Thread.sleep(wait);
} catch (InterruptedException ex) {
// ignore
}
wait -= System.currentTimeMillis() - start;
}
boolean empty = manager.getRetransmissionQueue().isEmpty();
assertTrue("Some messages are not acknowledged", empty);
}