final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, DecoupledClientServerTest.PORT);
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
RMManager manager = bus.getExtension(RMManager.class);
try {
greeter.greetMeOneWay("oneway");
} catch (Exception e) {
// no exception shall be thrown when the message is queued for retransmission
fail("fault thrown after queued for retransmission: " + e);
}
// the message shall be in the queue
assertFalse("RetransmissionQueue empty", manager.getRetransmissionQueue().isEmpty());
tes.setWorking(true);
long wait = 10000;
while (wait > 0) {
long start = System.currentTimeMillis();
try {
Thread.sleep(wait);
} catch (InterruptedException ex) {
// ignore
}
wait -= System.currentTimeMillis() - start;
}
// the message shall no longer be in the queue
assertTrue("RetransmissionQueue not empty", manager.getRetransmissionQueue().isEmpty());
}