use of org.talend.esb.mep.requestcallback.test.internal.HelloWorldImpl2 in project tesb-rt-se by Talend.
the class JmsConfiguratorTest method testCreateAndConfigureEndpoint.
@Test
public void testCreateAndConfigureEndpoint() {
HelloWorldImpl2 implementor = new HelloWorldImpl2();
String address = "local://JmsUriConfiguratorTest";
ep = Endpoint.publish(address, implementor);
JmsConfigurator jmsConfigurator = JmsConfigurator.create(ep);
Assert.assertNotNull(jmsConfigurator);
Assert.assertEquals("HelloWorldImpl2Port", jmsConfigurator.getConfigurationPrefix());
Assert.assertEquals(SERVICE_NAME, jmsConfigurator.getServiceName());
JMSConfiguration jmsConf = new JMSConfiguration();
jmsConfigurator.setJmsConfiguration(jmsConf);
Endpoint ep2 = jmsConfigurator.configureEndpoint(ep);
Assert.assertNotNull(ep2);
Configuration cnf = jmsConfigurator.getConfiguration();
Assert.assertNotNull(cnf);
Assert.assertEquals("org.apache.activemq.jndi.ActiveMQInitialContextFactory", cnf.get("jndiInitialContextFactory"));
Assert.assertEquals("jndi", cnf.get("variant"));
Assert.assertEquals("ConnectionFactory", cnf.get("jndiConnectionFactoryName"));
Assert.assertEquals("tcp://localhost:61616", cnf.get("jndiURL"));
Assert.assertEquals("dynamicQueues/libraryprovider.queue", cnf.get("destinationName"));
List<Feature> features = ((EndpointImpl) ep2).getFeatures();
boolean jmsConfigFeaturePresent = false;
for (Feature f : features) {
if (f instanceof org.apache.cxf.transport.jms.JMSConfigFeature) {
jmsConfigFeaturePresent = true;
break;
}
}
Assert.assertTrue(jmsConfigFeaturePresent);
}
Aggregations