1 18 package org.apache.activemq; 19 20 import org.apache.activemq.test.JmsTopicSendReceiveTest; 21 22 import javax.jms.DeliveryMode ; 23 import javax.jms.Destination ; 24 import javax.jms.MessageConsumer ; 25 import javax.jms.Topic ; 26 27 28 31 public class JmsQueueCompositeSendReceiveTest extends JmsTopicSendReceiveTest { 32 private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory 33 .getLog(JmsQueueCompositeSendReceiveTest.class); 34 35 40 protected void setUp() throws Exception { 41 topic = false; 42 deliveryMode = DeliveryMode.NON_PERSISTENT; 43 super.setUp(); 44 } 45 46 52 protected String getConsumerSubject() { 53 return "FOO.BAR.HUMBUG"; 54 } 55 56 62 protected String getProducerSubject() { 63 return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2"; 64 } 65 66 71 public void testSendReceive() throws Exception { 72 super.testSendReceive(); 73 messages.clear(); 74 Destination consumerDestination = consumeSession.createQueue("FOO.BAR.HUMBUG2"); 75 log.info("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass()); 76 MessageConsumer consumer = null; 77 if (durable) { 78 log.info("Creating durable consumer"); 79 consumer = consumeSession.createDurableSubscriber((Topic ) consumerDestination, getName()); 80 } else { 81 consumer = consumeSession.createConsumer(consumerDestination); 82 } 83 consumer.setMessageListener(this); 84 85 assertMessagesAreReceived(); 86 log.info("" + data.length + " messages(s) received, closing down connections"); 87 } 88 } 89 | Popular Tags |