activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carfield Yim <>
Subject Re: Question about unit test with activemq
Date Mon, 28 May 2007 06:24:30 GMT

Carfield Yim wrote:
>> How about creating a consumer to receive the message and asserting the
>> message? There are examples of this throughout the ActiveMQ tests.
>> There's a really simple one in the
>> JMSConsumerTest.testReceiveMessageWithConsumer() test:
> Can I not do that? Look like pretty complicate for just assert value
> in unit test.

The reason I ask that because now I setup the test using very simple code:

public class JmsQueueSenderTest
	JmsTemplate102 jt;
	ActiveMQQueue queue;

	public void setup()
		ConnectionFactory connectionFactory = new
		jt = new JmsTemplate102(connectionFactory, false);
		queue = new ActiveMQQueue("queue");
	public void testSimpleSend()
		jt.send(queue, new MessageCreator()
			public Message createMessage(Session session) throws JMSException
				return session.createTextMessage("test");

I haven't really create a session and I hope I don't need to do so for just
a unit test
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message