use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method gatewayWithDurableSubscription.
@Test
public void gatewayWithDurableSubscription() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("inboundGatewayWithDurableSubscription.xml", this.getClass());
JmsMessageDrivenEndpoint endpoint = context.getBean("gateway", JmsMessageDrivenEndpoint.class);
DefaultMessageListenerContainer container = (DefaultMessageListenerContainer) new DirectFieldAccessor(endpoint).getPropertyValue("listenerContainer");
assertEquals(Boolean.TRUE, container.isPubSubDomain());
assertEquals(Boolean.TRUE, container.isSubscriptionDurable());
assertEquals("testDurableSubscriptionName", container.getDurableSubscriptionName());
assertEquals("testClientId", container.getClientId());
assertTrue(container.isSubscriptionShared());
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method replyQosPropertiesDisabledByDefault.
@Test
public void replyQosPropertiesDisabledByDefault() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("inboundGatewayDefault.xml", this.getClass());
JmsMessageDrivenEndpoint gateway = context.getBean("gateway", JmsMessageDrivenEndpoint.class);
DirectFieldAccessor accessor = new DirectFieldAccessor(new DirectFieldAccessor(gateway).getPropertyValue("listener"));
assertEquals(false, accessor.getPropertyValue("explicitQosEnabledForReplies"));
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method testGatewayWithConnectionFactoryAndDestination.
@Test
public void testGatewayWithConnectionFactoryAndDestination() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsGatewayWithConnectionFactoryAndDestination.xml", this.getClass());
PollableChannel channel = (PollableChannel) context.getBean("requestChannel");
JmsMessageDrivenEndpoint gateway = (JmsMessageDrivenEndpoint) context.getBean("jmsGateway");
assertEquals(JmsMessageDrivenEndpoint.class, gateway.getClass());
context.start();
Message<?> message = channel.receive(10000);
MessageHistory history = MessageHistory.read(message);
assertNotNull(history);
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "jmsGateway", 0);
assertNotNull(componentHistoryRecord);
assertEquals("jms:inbound-gateway", componentHistoryRecord.get("type"));
assertNotNull("message should not be null", message);
assertEquals("message-driven-test", message.getPayload());
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method testGatewayWithDefaultConnectionFactory.
@Test
public void testGatewayWithDefaultConnectionFactory() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsGatewayWithDefaultConnectionFactory.xml", this.getClass());
PollableChannel channel = (PollableChannel) context.getBean("requestChannel");
JmsMessageDrivenEndpoint gateway = (JmsMessageDrivenEndpoint) context.getBean("jmsGateway");
assertEquals(JmsMessageDrivenEndpoint.class, gateway.getClass());
context.start();
Message<?> message = channel.receive(10000);
assertNotNull("message should not be null", message);
assertEquals("message-driven-test", message.getPayload());
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsMessageDrivenChannelAdapterParserTests method adapterWithTaskExecutor.
@Test
public void adapterWithTaskExecutor() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsInboundWithTaskExecutor.xml", this.getClass());
JmsMessageDrivenEndpoint endpoint = context.getBean("messageDrivenAdapter.adapter", JmsMessageDrivenEndpoint.class);
DefaultMessageListenerContainer container = TestUtils.getPropertyValue(endpoint, "listenerContainer", DefaultMessageListenerContainer.class);
assertSame(context.getBean("exec"), TestUtils.getPropertyValue(container, "taskExecutor"));
endpoint.stop();
context.close();
}
Aggregations