From 5ca4376b9915712c33eebb9869d5dccbb03a3a38 Mon Sep 17 00:00:00 2001 From: Iwein Fuld Date: Sun, 31 Jan 2010 13:24:34 +0000 Subject: [PATCH] delaying start invocation until after subscription of listeners --- .../JmsDestinationBackedMessageChannelTests.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/org.springframework.integration.jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java b/org.springframework.integration.jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java index 4a0d069f9a..da8df0c70b 100644 --- a/org.springframework.integration.jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java +++ b/org.springframework.integration.jms/src/test/java/org/springframework/integration/jms/JmsDestinationBackedMessageChannelTests.java @@ -19,11 +19,6 @@ package org.springframework.integration.jms; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.support.BeanDefinitionBuilder; @@ -39,6 +34,8 @@ import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import static org.junit.Assert.*; + /** * @author Mark Fisher */ @@ -117,10 +114,10 @@ public class JmsDestinationBackedMessageChannelTests { JmsDestinationBackedMessageChannel channel = new JmsDestinationBackedMessageChannel(this.connectionFactory, this.topic); channel.afterPropertiesSet(); - channel.start(); channel.subscribe(handler1); - channel.subscribe(handler2); - channel.send(new StringMessage("foo")); + channel.subscribe(handler2); + channel.start(); + channel.send(new StringMessage("foo")); channel.send(new StringMessage("bar")); latch.await(TIMEOUT, TimeUnit.MILLISECONDS); assertEquals(2, receivedList1.size());