diff --git a/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java b/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java index ff7c52aee5..21565b63d9 100644 --- a/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java +++ b/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; +import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -76,6 +77,33 @@ public class JmsGatewayParserTests { context.stop(); } + @Test + public void testGatewayWithDefaultExpectReply() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewaysWithExpectReplyAttributes.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("defaultGateway"); + DirectFieldAccessor accessor = new DirectFieldAccessor(gateway); + assertEquals(Boolean.FALSE, accessor.getPropertyValue("expectReply")); + } + + @Test + public void testGatewayExpectingReply() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewaysWithExpectReplyAttributes.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayExpectingReply"); + DirectFieldAccessor accessor = new DirectFieldAccessor(gateway); + assertEquals(Boolean.TRUE, accessor.getPropertyValue("expectReply")); + } + + @Test + public void testGatewayNotExpectingReply() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewaysWithExpectReplyAttributes.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayNotExpectingReply"); + DirectFieldAccessor accessor = new DirectFieldAccessor(gateway); + assertEquals(Boolean.FALSE, accessor.getPropertyValue("expectReply")); + } + @Test(expected=BeanDefinitionStoreException.class) public void testGatewayWithConnectionFactoryOnly() { try { diff --git a/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewaysWithExpectReplyAttributes.xml b/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewaysWithExpectReplyAttributes.xml new file mode 100644 index 0000000000..74d00db1e2 --- /dev/null +++ b/spring-integration-adapters/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewaysWithExpectReplyAttributes.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + +