Added timeout to prevent indefinitely blocking tests.

This commit is contained in:
Mark Fisher
2007-12-27 19:11:25 +00:00
parent 076a88eb41
commit 5c5bcdf2fc
2 changed files with 3 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ public class MessageBusTests {
endpoint.setDefaultOutputChannelName("targetChannel");
bus.registerEndpoint("endpoint", endpoint);
bus.start();
Message<?> result = targetChannel.receive();
Message<?> result = targetChannel.receive(1000);
assertEquals("test", result.getPayload());
bus.stop();
}

View File

@@ -19,6 +19,7 @@ package org.springframework.integration.endpoint.annotation;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.channel.MessageChannel;
@@ -37,7 +38,7 @@ public class MessageEndpointAnnotationPostProcessorTests {
MessageChannel inputChannel = (MessageChannel) context.getBean("inputChannel");
MessageChannel outputChannel = (MessageChannel) context.getBean("outputChannel");
inputChannel.send(new GenericMessage<String>(1, "world"));
Message<String> message = outputChannel.receive();
Message<String> message = outputChannel.receive(1000);
assertEquals("hello world", message.getPayload());
context.stop();
}