@Test public void queueNameWithResolverChannel() { assertEquals(JmsDestinationBackedMessageChannel.class, queueNameWithResolverChannel.getClass()); JmsDestinationBackedMessageChannel channel = (JmsDestinationBackedMessageChannel) queueNameWithResolverChannel; DirectFieldAccessor accessor = new DirectFieldAccessor(channel); JmsTemplate jmsTemplate = (JmsTemplate) accessor.getPropertyValue("jmsTemplate"); AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) accessor.getPropertyValue("container"); assertEquals("foo", jmsTemplate.getDefaultDestinationName()); assertEquals("foo", container.getDestinationName()); }
private void assertDefaultJmsConfig(AbstractMessageListenerContainer container) { assertEquals(connectionFactory, container.getConnectionFactory()); assertEquals(destinationResolver, container.getDestinationResolver()); assertEquals(messageConverter, container.getMessageConverter()); assertEquals(true, container.isSessionTransacted()); assertEquals(Session.DUPS_OK_ACKNOWLEDGE, container.getSessionAcknowledgeMode()); assertEquals(true, container.isPubSubDomain()); assertEquals(true, container.isReplyPubSubDomain()); assertEquals(true, container.isSubscriptionDurable()); assertEquals("client-1234", container.getClientId()); assertEquals(false, container.isAutoStartup()); }
@Test public void topicReferenceChannel() { assertEquals(JmsDestinationBackedMessageChannel.class, topicReferenceChannel.getClass()); JmsDestinationBackedMessageChannel channel = (JmsDestinationBackedMessageChannel) 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()); }