Fix timing problem on UDP test case (send before ready to receive)
This commit is contained in:
@@ -116,6 +116,16 @@ public class UdpUnicastEndToEndTests implements Runnable {
|
||||
public void run() {
|
||||
AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
|
||||
"testIp-in-context.xml", UdpUnicastEndToEndTests.class);
|
||||
UnicastReceivingChannelAdapter inbound = ctx.getBean(UnicastReceivingChannelAdapter.class);
|
||||
int n = 0;
|
||||
try {
|
||||
while (!inbound.isListening()) {
|
||||
Thread.sleep(100);
|
||||
if (n++ > 100) {
|
||||
throw new RuntimeException("Failed to start listening");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) { }
|
||||
while (okToRun) {
|
||||
try {
|
||||
readyToReceive.countDown();
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
acknowledge="true"
|
||||
ack-host="localhost"
|
||||
ack-port="22222"
|
||||
ack-timeout="2000"
|
||||
ack-timeout="10000"
|
||||
channel="outputChannel"/>
|
||||
|
||||
<beans:import resource="testIp-common-context.xml" />
|
||||
|
||||
Reference in New Issue
Block a user