From 74422b06d1deb7025b1c0c50fe9695953a0f9eda Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Tue, 27 Jul 2010 16:30:00 +0000 Subject: [PATCH] Fix Timing Problem with JmsDestinationBackedMessageTests - Wait for Listener Container Consumer Registration - needed in the topic by name test too --- .../jms/JmsDestinationBackedMessageChannelTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java index 748c52a814..e9ffdcc56f 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java @@ -188,6 +188,9 @@ public class JmsDestinationBackedMessageChannelTests { new JmsDestinationBackedMessageChannel(this.connectionFactory, "dynamicTopic", true); channel.afterPropertiesSet(); channel.start(); + if (!channel.waitRegisteredWithDestination(10000)) { + fail("Listener failed to subscribe to topic"); + } channel.subscribe(handler1); channel.subscribe(handler2); channel.send(new StringMessage("foo"));