1 18 package org.apache.activemq.transport.nio; 19 20 import org.apache.activemq.JmsDurableTopicSendReceiveTest; 21 import org.apache.activemq.ActiveMQConnectionFactory; 22 import org.apache.activemq.broker.BrokerService; 23 24 public class NIOJmsDurableTopicSendReceiveTest extends JmsDurableTopicSendReceiveTest { 25 protected BrokerService broker; 26 27 protected void setUp() throws Exception { 28 if (broker == null) { 29 broker = createBroker(); 30 broker.start(); 31 } 32 super.setUp(); 33 } 34 35 protected void tearDown() throws Exception { 36 super.tearDown(); 37 if (broker != null) { 38 broker.stop(); 39 } 40 } 41 42 protected ActiveMQConnectionFactory createConnectionFactory() { 43 ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(getBrokerURL()); 44 return connectionFactory; 45 } 46 47 protected String getBrokerURL() { 48 return "nio://localhost:61616"; 49 } 50 51 protected BrokerService createBroker() throws Exception { 52 BrokerService answer = new BrokerService(); 53 answer.setPersistent(false); 54 answer.addConnector(getBrokerURL()); 55 return answer; 56 } 57 } 58 | Popular Tags |