TopicConfiguration topicConfig = new TopicConfigurationImpl(RandomUtil.randomString(),
"/topic/binding1",
"/topic/binding2");
jmsConfiguration.getTopicConfigurations().add(topicConfig);
JMSServerManager server = new JMSServerManagerImpl(coreServer, jmsConfiguration);
server.start();
for (String binding : cfConfig.getBindings())
{
Object o = context.lookup(binding);
Assert.assertNotNull(o);
Assert.assertTrue(o instanceof ConnectionFactory);
ConnectionFactory cf = (ConnectionFactory)o;
Connection connection = cf.createConnection();
connection.close();
}
for (String binding : queueConfig.getBindings())
{
Object o = context.lookup(binding);
Assert.assertNotNull(o);
Assert.assertTrue(o instanceof Queue);
Queue queue = (Queue)o;
Assert.assertEquals(queueConfig.getName(), queue.getQueueName());
}
for (String binding : topicConfig.getBindings())
{
Object o = context.lookup(binding);
Assert.assertNotNull(o);
Assert.assertTrue(o instanceof Topic);
Topic topic = (Topic)o;
Assert.assertEquals(topicConfig.getName(), topic.getTopicName());
}
server.stop();
}