diff --git a/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java b/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java index 8af87b66ce..c51742135c 100644 --- a/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java +++ b/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/JmsGatewayParserTests.java @@ -31,6 +31,7 @@ import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.Message; import org.springframework.jms.connection.JmsTransactionManager; +import org.springframework.jms.listener.AbstractMessageListenerContainer; /** * @author Mark Fisher @@ -163,4 +164,52 @@ public class JmsGatewayParserTests { assertEquals(context.getBean("testConnectionFactory"), ((JmsTransactionManager) txManager).getConnectionFactory()); } + @Test + public void testGatewayWithConcurrentConsumers() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewayWithContainerSettings.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayWithConcurrentConsumers"); + gateway.start(); + AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) + new DirectFieldAccessor(gateway).getPropertyValue("container"); + assertEquals(3, new DirectFieldAccessor(container).getPropertyValue("concurrentConsumers")); + gateway.stop(); + } + + @Test + public void testGatewayWithMaxConcurrentConsumers() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewayWithContainerSettings.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayWithMaxConcurrentConsumers"); + gateway.start(); + AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) + new DirectFieldAccessor(gateway).getPropertyValue("container"); + assertEquals(22, new DirectFieldAccessor(container).getPropertyValue("maxConcurrentConsumers")); + gateway.stop(); + } + + @Test + public void testGatewayWithMaxMessagesPerTask() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewayWithContainerSettings.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayWithMaxMessagesPerTask"); + gateway.start(); + AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) + new DirectFieldAccessor(gateway).getPropertyValue("container"); + assertEquals(99, new DirectFieldAccessor(container).getPropertyValue("maxMessagesPerTask")); + gateway.stop(); + } + + @Test + public void testGatewayWithIdleTaskExecutionLimit() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "jmsGatewayWithContainerSettings.xml", this.getClass()); + JmsGateway gateway = (JmsGateway) context.getBean("gatewayWithIdleTaskExecutionLimit"); + gateway.start(); + AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) + new DirectFieldAccessor(gateway).getPropertyValue("container"); + assertEquals(7, new DirectFieldAccessor(container).getPropertyValue("idleTaskExecutionLimit")); + gateway.stop(); + } + } diff --git a/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewayWithContainerSettings.xml b/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewayWithContainerSettings.xml new file mode 100644 index 0000000000..f19a7e4280 --- /dev/null +++ b/org.springframework.integration.adapter/src/test/java/org/springframework/integration/adapter/jms/config/jmsGatewayWithContainerSettings.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java index 535fec6613..c8b070fc47 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java @@ -90,7 +90,7 @@ public class BroadcastingDispatcherTests { verify(globalMocks); } - @Test(timeout = 100) + @Test(timeout = 500) public void multipleTargetsPartialTimout() throws Exception { reset(taskExecutorMock); dispatcher.addTarget(targetMock);