use of org.springframework.integration.jms.JmsOutboundGateway in project spring-integration by spring-projects.
the class JmsOutboundGatewayParserTests method gatewayWithDestName.
@Test
public void gatewayWithDestName() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundGatewayReplyDestOptions.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("jmsGatewayDestName");
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
accessor = new DirectFieldAccessor(gateway);
assertEquals("replyQueueName", accessor.getPropertyValue("replyDestinationName"));
context.close();
}
use of org.springframework.integration.jms.JmsOutboundGateway in project spring-integration by spring-projects.
the class JmsOutboundGatewayParserTests method gatewayWithDestBeanRefExpression.
@Test
public void gatewayWithDestBeanRefExpression() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundGatewayReplyDestOptions.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("jmsGatewayDestExpressionBeanRef");
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
ExpressionEvaluatingMessageProcessor<?> processor = TestUtils.getPropertyValue(gateway, "replyDestinationExpressionProcessor", ExpressionEvaluatingMessageProcessor.class);
Expression expression = TestUtils.getPropertyValue(gateway, "replyDestinationExpressionProcessor.expression", Expression.class);
assertEquals("@replyQueue", expression.getExpressionString());
assertSame(context.getBean("replyQueue"), processor.processMessage(null));
context.close();
}
use of org.springframework.integration.jms.JmsOutboundGateway in project spring-integration by spring-projects.
the class JmsOutboundGatewayParserTests method gatewayWithDest.
@Test
public void gatewayWithDest() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundGatewayReplyDestOptions.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("jmsGatewayDest");
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
accessor = new DirectFieldAccessor(gateway);
assertSame(context.getBean("replyQueue"), accessor.getPropertyValue("replyDestination"));
context.close();
}
use of org.springframework.integration.jms.JmsOutboundGateway in project spring-integration by spring-projects.
the class JmsOutboundGatewayParserTests method testWithDeliveryPersistentAttribute.
@Test
public void testWithDeliveryPersistentAttribute() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsOutboundGatewayWithDeliveryPersistent.xml", this.getClass());
EventDrivenConsumer endpoint = (EventDrivenConsumer) context.getBean("jmsGateway");
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
JmsOutboundGateway gateway = (JmsOutboundGateway) accessor.getPropertyValue("handler");
accessor = new DirectFieldAccessor(gateway);
int deliveryMode = (Integer) accessor.getPropertyValue("deliveryMode");
assertEquals(DeliveryMode.PERSISTENT, deliveryMode);
assertTrue(TestUtils.getPropertyValue(gateway, "async", Boolean.class));
DefaultMessageListenerContainer container = TestUtils.getPropertyValue(gateway, "replyContainer", DefaultMessageListenerContainer.class);
assertEquals(4, TestUtils.getPropertyValue(container, "concurrentConsumers"));
assertEquals(5, TestUtils.getPropertyValue(container, "maxConcurrentConsumers"));
assertEquals(10, TestUtils.getPropertyValue(container, "maxMessagesPerTask"));
assertEquals(2000L, TestUtils.getPropertyValue(container, "receiveTimeout"));
Object recoveryInterval;
try {
recoveryInterval = TestUtils.getPropertyValue(container, "recoveryInterval");
} catch (NotReadablePropertyException e) {
recoveryInterval = TestUtils.getPropertyValue(container, "backOff.interval");
}
assertEquals(10000L, recoveryInterval);
assertEquals(7, TestUtils.getPropertyValue(container, "idleConsumerLimit"));
assertEquals(2, TestUtils.getPropertyValue(container, "idleTaskExecutionLimit"));
assertEquals(3, TestUtils.getPropertyValue(container, "cacheLevel"));
assertTrue(container.isSessionTransacted());
assertSame(context.getBean("exec"), TestUtils.getPropertyValue(container, "taskExecutor"));
assertEquals(1234000L, TestUtils.getPropertyValue(gateway, "idleReplyContainerTimeout"));
context.close();
}
Aggregations