use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsMessageDrivenChannelAdapterParserTests method testAdapterWithIdleTaskExecutionLimit.
@Test
public void testAdapterWithIdleTaskExecutionLimit() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsInboundWithContainerSettings.xml", this.getClass());
JmsMessageDrivenEndpoint adapter = (JmsMessageDrivenEndpoint) context.getBean("adapterWithIdleTaskExecutionLimit.adapter");
adapter.start();
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) new DirectFieldAccessor(adapter).getPropertyValue("listenerContainer");
assertEquals(7, new DirectFieldAccessor(container).getPropertyValue("idleTaskExecutionLimit"));
adapter.stop();
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsMessageDrivenChannelAdapterParserTests method adapterWithPubSubDomain.
@Test
public void adapterWithPubSubDomain() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsInboundWithPubSubDomain.xml", this.getClass());
JmsMessageDrivenEndpoint endpoint = context.getBean("messageDrivenAdapter", JmsMessageDrivenEndpoint.class);
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) new DirectFieldAccessor(endpoint).getPropertyValue("listenerContainer");
assertEquals(Boolean.TRUE, container.isPubSubDomain());
// INT-3680
assertFalse(container.isSubscriptionDurable());
assertNull(container.getDurableSubscriptionName());
endpoint.stop();
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsMessageDrivenChannelAdapterParserTests method testAdapterWithReceiveTimeout.
@Test
public void testAdapterWithReceiveTimeout() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsInboundWithContainerSettings.xml", this.getClass());
JmsMessageDrivenEndpoint adapter = (JmsMessageDrivenEndpoint) context.getBean("adapterWithReceiveTimeout.adapter");
adapter.start();
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) new DirectFieldAccessor(adapter).getPropertyValue("listenerContainer");
assertEquals(1111L, new DirectFieldAccessor(container).getPropertyValue("receiveTimeout"));
adapter.stop();
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsMessageDrivenChannelAdapterParserTests method adapterWithMessageSelector.
@Test
public void adapterWithMessageSelector() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsInboundWithMessageSelector.xml", this.getClass());
PollableChannel output = (PollableChannel) context.getBean("output2");
Message<?> message = output.receive(timeoutOnReceive);
MessageHistory history = MessageHistory.read(message);
assertNotNull(history);
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "messageDrivenAdapter", 0);
assertNotNull(componentHistoryRecord);
JmsMessageDrivenEndpoint endpoint = context.getBean("messageDrivenAdapter", JmsMessageDrivenEndpoint.class);
assertEquals("jms:message-driven-channel-adapter", componentHistoryRecord.get("type"));
assertNotNull("message should not be null", message);
assertEquals("test [with selector: TestProperty = 'foo']", message.getPayload());
endpoint.stop();
context.close();
}
use of org.springframework.integration.jms.JmsMessageDrivenEndpoint in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method gatewayWithPubSubDomain.
@Test
public void gatewayWithPubSubDomain() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("jmsGatewayWithPubSubDomain.xml", this.getClass());
JmsMessageDrivenEndpoint endpoint = context.getBean("gateway", JmsMessageDrivenEndpoint.class);
JmsDestinationAccessor container = (JmsDestinationAccessor) new DirectFieldAccessor(endpoint).getPropertyValue("listenerContainer");
assertEquals(Boolean.TRUE, container.isPubSubDomain());
context.close();
}
Aggregations