@Override protected void tearDown() throws Exception { if (server != null) { server.stop(); } server = null; connectorConfig = null; super.tearDown(); }
@Override @Before public void setUp() throws Exception { super.setUp(); Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true); server = createServer(false, config); server.setMBeanServer(mbeanServer); server.start(); ServerLocator locator = createInVMNonHALocator().setBlockOnNonDurableSend(true); ClientSessionFactory sf = createSessionFactory(locator); session = sf.createSession(false, true, false); session.start(); }
@Override protected void setUp() throws Exception { super.setUp(); Map<String, Object> params = new HashMap<String, Object>(); // params.put(RandomUtil.randomString(), RandomUtil.randomBoolean()); connectorConfig = new TransportConfiguration( InVMConnectorFactory.class.getName(), params, RandomUtil.randomString()); conf = createDefaultConfig(false); conf.setSecurityEnabled(false); conf.setJMXManagementEnabled(true); conf.getAcceptorConfigurations().clear(); conf.getAcceptorConfigurations() .add(new TransportConfiguration(InVMAcceptorFactory.class.getName())); server = HornetQServers.newHornetQServer(conf, mbeanServer, true); conf.getConnectorConfigurations().put(connectorConfig.getName(), connectorConfig); server.start(); }
@Override @Before public void setUp() throws Exception { super.setUp(); Configuration conf = createBasicConfig(); conf.setSecurityEnabled(false); conf.setJMXManagementEnabled(true); conf.getAcceptorConfigurations() .add(new TransportConfiguration(InVMAcceptorFactory.class.getName())); server = createServer(false, conf, mbeanServer); server.start(); locator = createInVMNonHALocator(); locator.setBlockOnNonDurableSend(true); locator.setBlockOnNonDurableSend(true); sf = createSessionFactory(locator); session = sf.createSession(false, true, false); session.start(); addClientSession(session); }
@Override protected void setUp() throws Exception { super.setUp(); Map<String, Object> acceptorParams = new HashMap<String, Object>(); acceptorParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1); TransportConfiguration acceptorConfig = new TransportConfiguration( InVMAcceptorFactory.class.getName(), acceptorParams, RandomUtil.randomString()); TransportConfiguration connectorConfig = new TransportConfiguration( InVMConnectorFactory.class.getName(), acceptorParams, RandomUtil.randomString()); CoreQueueConfiguration sourceQueueConfig = new CoreQueueConfiguration( RandomUtil.randomString(), RandomUtil.randomString(), null, false); CoreQueueConfiguration targetQueueConfig = new CoreQueueConfiguration( RandomUtil.randomString(), RandomUtil.randomString(), null, false); List<String> connectors = new ArrayList<String>(); connectors.add(connectorConfig.getName()); bridgeConfig = new BridgeConfiguration( RandomUtil.randomString(), sourceQueueConfig.getName(), targetQueueConfig.getAddress(), null, null, HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE, HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD, HornetQClient.DEFAULT_CONNECTION_TTL, RandomUtil.randomPositiveLong(), HornetQClient.DEFAULT_MAX_RETRY_INTERVAL, RandomUtil.randomDouble(), RandomUtil.randomPositiveInt(), RandomUtil.randomBoolean(), RandomUtil.randomPositiveInt(), connectors, false, ConfigurationImpl.DEFAULT_CLUSTER_USER, ConfigurationImpl.DEFAULT_CLUSTER_PASSWORD); Configuration conf_1 = createBasicConfig(); conf_1.setSecurityEnabled(false); conf_1.setJMXManagementEnabled(true); conf_1.setClustered(true); conf_1.getAcceptorConfigurations().add(acceptorConfig); conf_1.getQueueConfigurations().add(targetQueueConfig); Configuration conf_0 = createBasicConfig(); conf_0.setSecurityEnabled(false); conf_0.setJMXManagementEnabled(true); conf_0.setClustered(true); conf_0 .getAcceptorConfigurations() .add(new TransportConfiguration(InVMAcceptorFactory.class.getName())); conf_0.getConnectorConfigurations().put(connectorConfig.getName(), connectorConfig); conf_0.getQueueConfigurations().add(sourceQueueConfig); conf_0.getBridgeConfigurations().add(bridgeConfig); server_1 = HornetQServers.newHornetQServer(conf_1, MBeanServerFactory.createMBeanServer(), false); addServer(server_1); server_1.start(); server_0 = HornetQServers.newHornetQServer(conf_0, mbeanServer, false); addServer(server_0); server_0.start(); }