1 17 package org.apache.activemq.broker; 18 19 import org.apache.activemq.network.NetworkConnector; 20 21 import junit.framework.TestCase; 22 23 27 public class BrokerServiceTest extends TestCase { 28 29 public void testAddRemoveTransportsWithJMX() throws Exception { 30 BrokerService service = new BrokerService(); 31 service.setUseJmx(true); 32 service.setPersistent(false); 33 TransportConnector connector = service.addConnector("tcp://localhost:0"); 34 service.start(); 35 36 service.removeConnector(connector); 37 connector.stop(); 38 service.stop(); 39 } 40 41 public void testAddRemoveTransportsWithoutJMX() throws Exception { 42 BrokerService service = new BrokerService(); 43 service.setPersistent(false); 44 service.setUseJmx(false); 45 TransportConnector connector = service.addConnector("tcp://localhost:0"); 46 service.start(); 47 48 service.removeConnector(connector); 49 connector.stop(); 50 service.stop(); 51 } 52 53 public void testAddRemoveNetworkWithJMX() throws Exception { 54 BrokerService service = new BrokerService(); 55 service.setPersistent(false); 56 service.setUseJmx(true); 57 NetworkConnector connector = service.addNetworkConnector("multicast://default"); 58 service.start(); 59 60 service.removeNetworkConnector(connector); 61 connector.stop(); 62 service.stop(); 63 } 64 65 public void testAddRemoveNetworkWithoutJMX() throws Exception { 66 BrokerService service = new BrokerService(); 67 service.setPersistent(false); 68 service.setUseJmx(false); 69 NetworkConnector connector = service.addNetworkConnector("multicast://default"); 70 service.start(); 71 72 service.removeNetworkConnector(connector); 73 connector.stop(); 74 service.stop(); 75 } 76 } 77 | Popular Tags |