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 JmsTopicCompositeSendReceiveTest extends JmsTopicSendReceiveTest { 32 private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory 33 .getLog(JmsTopicCompositeSendReceiveTest.class); 34 35 Destination consumerDestination2; 36 MessageConsumer consumer2; 37 38 43 protected void setUp() throws Exception { 44 deliveryMode = DeliveryMode.NON_PERSISTENT; 45 super.setUp(); 46 consumerDestination2 = consumeSession.createTopic("FOO.BAR.HUMBUG2"); 47 log.info("Created consumer destination: " + consumerDestination2 + " of type: " + consumerDestination2.getClass()); 48 if (durable) { 49 log.info("Creating durable consumer"); 50 consumer2 = consumeSession.createDurableSubscriber((Topic ) consumerDestination2, getName()); 51 } else { 52 consumer2 = consumeSession.createConsumer(consumerDestination2); 53 } 54 55 } 56 57 63 protected String getConsumerSubject() { 64 return "FOO.BAR.HUMBUG"; 65 } 66 67 73 protected String getProducerSubject() { 74 return "FOO.BAR.HUMBUG,FOO.BAR.HUMBUG2"; 75 } 76 77 82 public void testSendReceive() throws Exception { 83 super.testSendReceive(); 84 messages.clear(); 85 consumer2.setMessageListener(this); 86 assertMessagesAreReceived(); 87 log.info("" + data.length + " messages(s) received, closing down connections"); 88 } 89 } 90 | Popular Tags |