use of org.apache.activemq.artemis.tests.unit.util.InVMNamingContext in project activemq-artemis by apache.
the class ManualReconnectionToSingleServerTest method setUp.
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@Override
@Before
public void setUp() throws Exception {
super.setUp();
context = new InVMNamingContext();
server = createServer(false, createDefaultNettyConfig());
JMSConfiguration configuration = new JMSConfigurationImpl();
serverManager = new JMSServerManagerImpl(server, configuration);
serverManager.setRegistry(new JndiBindingRegistry(context));
configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl().setName(QUEUE_NAME).setBindings(QUEUE_NAME));
ArrayList<TransportConfiguration> configs = new ArrayList<>();
configs.add(new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl().setName("cf").setConnectorNames(registerConnectors(server, configs)).setBindings("/cf").setRetryInterval(1000).setReconnectAttempts(-1);
configuration.getConnectionFactoryConfigurations().add(cfConfig);
serverManager.start();
listener = new Listener();
exceptionLatch = new CountDownLatch(1);
reconnectionLatch = new CountDownLatch(1);
allMessagesReceived = new CountDownLatch(1);
}
use of org.apache.activemq.artemis.tests.unit.util.InVMNamingContext in project activemq-artemis by apache.
the class RemoteConnectionStressTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
mbeanServer = MBeanServerFactory.createMBeanServer();
server = addServer(ActiveMQServers.newActiveMQServer(createDefaultNettyConfig(), mbeanServer, false));
InVMNamingContext namingContext = new InVMNamingContext();
jmsServer = new JMSServerManagerImpl(server);
jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
jmsServer.start();
jmsServer.createQueue(true, "SomeQueue", null, true, "/jms/SomeQueue");
}
use of org.apache.activemq.artemis.tests.unit.util.InVMNamingContext in project activemq-artemis by apache.
the class JMSServerDeployerTest method setUp.
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@Override
@Before
public void setUp() throws Exception {
super.setUp();
DiscoveryGroupConfiguration dcg = new DiscoveryGroupConfiguration().setName("mygroup").setRefreshTimeout(5432).setDiscoveryInitialWaitTimeout(5432).setBroadcastEndpointFactory(new UDPBroadcastEndpointFactory().setGroupAddress(getUDPDiscoveryAddress()).setGroupPort(getUDPDiscoveryPort()).setLocalBindAddress("172.16.8.10"));
config = createBasicConfig().addConnectorConfiguration("netty", new TransportConfiguration(NettyConnectorFactory.class.getName())).addDiscoveryGroupConfiguration("mygroup", dcg);
ActiveMQServer server = createServer(false, config);
jmsServer = new JMSServerManagerImpl(server);
context = new InVMNamingContext();
jmsServer.setRegistry(new JndiBindingRegistry(context));
jmsServer.start();
}
Aggregations