use of org.springframework.integration.endpoint.EventDrivenConsumer in project spring-integration by spring-projects.
the class JmsOutboundChannelAdapterParserTests method adapterWithMessageConverter.
@Test
public void adapterWithMessageConverter() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithMessageConverter.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("adapter");
DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(new DirectFieldAccessor(endpoint).getPropertyValue("handler"));
JmsTemplate jmsTemlate = (JmsTemplate) handlerAccessor.getPropertyValue("jmsTemplate");
MessageConverter messageConverter = jmsTemlate.getMessageConverter();
assertNotNull(messageConverter);
assertEquals(TestMessageConverter.class, messageConverter.getClass());
context.close();
}
use of org.springframework.integration.endpoint.EventDrivenConsumer in project spring-integration by spring-projects.
the class JmsOutboundChannelAdapterParserTests method adapterWithQosSettings.
@Test
public void adapterWithQosSettings() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithQos.xml", this.getClass());
EventDrivenConsumer endpoint = context.getBean("qosAdapter", EventDrivenConsumer.class);
DirectFieldAccessor accessor = new DirectFieldAccessor(new DirectFieldAccessor(new DirectFieldAccessor(endpoint).getPropertyValue("handler")).getPropertyValue("jmsTemplate"));
assertEquals(true, accessor.getPropertyValue("explicitQosEnabled"));
assertEquals(12345L, accessor.getPropertyValue("timeToLive"));
assertEquals(7, accessor.getPropertyValue("priority"));
assertEquals(DeliveryMode.NON_PERSISTENT, accessor.getPropertyValue("deliveryMode"));
context.close();
}
use of org.springframework.integration.endpoint.EventDrivenConsumer in project spring-integration by spring-projects.
the class JmsOutboundChannelAdapterParserTests method adapterWithJmsTemplate.
@Test
public void adapterWithJmsTemplate() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithJmsTemplate.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("adapter");
DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(new DirectFieldAccessor(endpoint).getPropertyValue("handler"));
JmsTemplate jmsTemplate = (JmsTemplate) handlerAccessor.getPropertyValue("jmsTemplate");
assertNotNull(jmsTemplate);
assertEquals(context.getBean("template"), jmsTemplate);
context.close();
}
use of org.springframework.integration.endpoint.EventDrivenConsumer in project spring-integration by spring-projects.
the class JmsOutboundChannelAdapterParserTests method advisedAdapter.
@Test
public void advisedAdapter() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithConnectionFactoryAndDestination.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("advised");
MessageHandler handler = TestUtils.getPropertyValue(endpoint, "handler", MessageHandler.class);
handler.handleMessage(new GenericMessage<String>("foo"));
assertEquals(1, adviceCalled);
context.close();
}
use of org.springframework.integration.endpoint.EventDrivenConsumer in project spring-integration by spring-projects.
the class JmsOutboundChannelAdapterParserTests method adapterWithOrder.
@Test
public void adapterWithOrder() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundWithOrder.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("adapter");
DirectFieldAccessor accessor = new DirectFieldAccessor(new DirectFieldAccessor(endpoint).getPropertyValue("handler"));
Object order = accessor.getPropertyValue("order");
assertEquals(123, order);
context.close();
}
Aggregations