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