use of org.springframework.integration.jms.SubscribableJmsChannel in project spring-integration by spring-projects.
the class JmsChannelParserTests method queueNameChannel.
@Test
public void queueNameChannel() {
assertEquals(SubscribableJmsChannel.class, queueNameChannel.getClass());
SubscribableJmsChannel channel = (SubscribableJmsChannel) queueNameChannel;
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
JmsTemplate jmsTemplate = (JmsTemplate) accessor.getPropertyValue("jmsTemplate");
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) accessor.getPropertyValue("container");
assertEquals("test.queue", jmsTemplate.getDefaultDestinationName());
assertEquals("test.queue", container.getDestinationName());
assertEquals(1, TestUtils.getPropertyValue(TestUtils.getPropertyValue(channel, "dispatcher"), "maxSubscribers", Integer.class).intValue());
}
use of org.springframework.integration.jms.SubscribableJmsChannel in project spring-integration by spring-projects.
the class JmsChannelParserTests method topicNameChannel.
@Test
public void topicNameChannel() {
assertEquals(SubscribableJmsChannel.class, topicNameChannel.getClass());
SubscribableJmsChannel channel = (SubscribableJmsChannel) topicNameChannel;
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
JmsTemplate jmsTemplate = (JmsTemplate) accessor.getPropertyValue("jmsTemplate");
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) accessor.getPropertyValue("container");
assertEquals("test.topic", jmsTemplate.getDefaultDestinationName());
assertEquals("test.topic", container.getDestinationName());
assertTrue(container.isSubscriptionShared());
assertTrue(container.isSubscriptionDurable());
assertEquals("subName", container.getSubscriptionName());
}
use of org.springframework.integration.jms.SubscribableJmsChannel in project spring-integration by spring-projects.
the class JmsChannelParserTests method topicReferenceChannel.
@Test
public void topicReferenceChannel() {
assertEquals(SubscribableJmsChannel.class, topicReferenceChannel.getClass());
SubscribableJmsChannel channel = (SubscribableJmsChannel) topicReferenceChannel;
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
JmsTemplate jmsTemplate = (JmsTemplate) accessor.getPropertyValue("jmsTemplate");
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) accessor.getPropertyValue("container");
assertEquals(topic, jmsTemplate.getDefaultDestination());
assertEquals(topic, container.getDestination());
assertSame(this.messageBuilderFactory, TestUtils.getPropertyValue(channel, "container.messageListener.messageBuilderFactory"));
}
use of org.springframework.integration.jms.SubscribableJmsChannel in project spring-integration by spring-projects.
the class JmsChannelParserTests method queueChannelWithInterceptors.
@Test
@SuppressWarnings("unchecked")
public void queueChannelWithInterceptors() {
assertEquals(SubscribableJmsChannel.class, queueChannelWithInterceptors.getClass());
SubscribableJmsChannel channel = (SubscribableJmsChannel) queueChannelWithInterceptors;
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
List<ChannelInterceptor> interceptors = (List<ChannelInterceptor>) new DirectFieldAccessor(accessor.getPropertyValue("interceptors")).getPropertyValue("interceptors");
assertEquals(1, interceptors.size());
assertEquals(TestInterceptor.class, interceptors.get(0).getClass());
}
use of org.springframework.integration.jms.SubscribableJmsChannel in project spring-integration by spring-projects.
the class JmsChannelParserTests method topicChannelWithInterceptors.
@Test
@SuppressWarnings("unchecked")
public void topicChannelWithInterceptors() {
assertEquals(SubscribableJmsChannel.class, topicChannelWithInterceptors.getClass());
SubscribableJmsChannel channel = (SubscribableJmsChannel) topicChannelWithInterceptors;
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
List<ChannelInterceptor> interceptors = (List<ChannelInterceptor>) new DirectFieldAccessor(accessor.getPropertyValue("interceptors")).getPropertyValue("interceptors");
assertEquals(2, interceptors.size());
assertEquals(TestInterceptor.class, interceptors.get(0).getClass());
assertEquals(TestInterceptor.class, interceptors.get(1).getClass());
}
Aggregations