String jmsConnectionURL = server1 + "," + server2 + "," + server3;
conf.set(HCatAccessorService.JMS_CONNECTIONS_PROPERTIES, jmsConnectionURL);
services.init();
HCatAccessorService hcatService = services.get(HCatAccessorService.class);
JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcatserver.blue.server.com:8020"));
// rules will be applied
assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp://broker.blue:61616",
connInfo.getJNDIPropertiesString());
connInfo = hcatService.getJMSConnectionInfo(new URI("http://unknown:9999/fs"));
// will map to default
assertEquals(
"java.naming.factory.initial#org.apache.activemq.jndi.ActiveMQInitialContextFactory;" +
"java.naming.provider.url#vm://localhost?broker.persistent=false",
connInfo.getJNDIPropertiesString());
connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://xyz.corp.dummy.com"));
assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp:localhost:61616",
connInfo.getJNDIPropertiesString());
}