Search in sources :

Example 1 with StubMessageConverter

use of org.springframework.integration.jms.StubMessageConverter in project spring-integration by spring-projects.

the class JmsOutboundGatewayParserTests method testDefault.

@Test
public void testDefault() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundGatewayWithConverter.xml", this.getClass());
    PollingConsumer endpoint = (PollingConsumer) context.getBean("jmsGateway");
    DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
    JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
    accessor = new DirectFieldAccessor(gateway);
    MessageConverter converter = (MessageConverter) accessor.getPropertyValue("messageConverter");
    assertTrue("Wrong message converter", converter instanceof StubMessageConverter);
    context.close();
}
Also used : PollingConsumer(org.springframework.integration.endpoint.PollingConsumer) StubMessageConverter(org.springframework.integration.jms.StubMessageConverter) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) JmsOutboundGateway(org.springframework.integration.jms.JmsOutboundGateway) MessageConverter(org.springframework.jms.support.converter.MessageConverter) StubMessageConverter(org.springframework.integration.jms.StubMessageConverter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 PollingConsumer (org.springframework.integration.endpoint.PollingConsumer)1 JmsOutboundGateway (org.springframework.integration.jms.JmsOutboundGateway)1 StubMessageConverter (org.springframework.integration.jms.StubMessageConverter)1 MessageConverter (org.springframework.jms.support.converter.MessageConverter)1