Search in sources :

Example 1 with JmsMessagingTemplate

use of org.springframework.jms.core.JmsMessagingTemplate in project spring-boot by spring-projects.

the class JmsAutoConfigurationTests method testDefaultJmsConfiguration.

@Test
public void testDefaultJmsConfiguration() {
    load(TestConfiguration.class);
    ActiveMQConnectionFactory connectionFactory = this.context.getBean(ActiveMQConnectionFactory.class);
    JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
    JmsMessagingTemplate messagingTemplate = this.context.getBean(JmsMessagingTemplate.class);
    assertThat(connectionFactory).isEqualTo(jmsTemplate.getConnectionFactory());
    assertThat(messagingTemplate.getJmsTemplate()).isEqualTo(jmsTemplate);
    assertThat(((ActiveMQConnectionFactory) jmsTemplate.getConnectionFactory()).getBrokerURL()).isEqualTo(ACTIVEMQ_EMBEDDED_URL);
    assertThat(this.context.containsBean("jmsListenerContainerFactory")).isTrue();
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) JmsMessagingTemplate(org.springframework.jms.core.JmsMessagingTemplate) JmsTemplate(org.springframework.jms.core.JmsTemplate) Test(org.junit.Test)

Example 2 with JmsMessagingTemplate

use of org.springframework.jms.core.JmsMessagingTemplate in project spring-boot by spring-projects.

the class JmsAutoConfigurationTests method testJmsMessagingTemplateBackOff.

@Test
public void testJmsMessagingTemplateBackOff() {
    load(TestConfiguration5.class);
    JmsMessagingTemplate messagingTemplate = this.context.getBean(JmsMessagingTemplate.class);
    assertThat(messagingTemplate.getDefaultDestinationName()).isEqualTo("fooBar");
}
Also used : JmsMessagingTemplate(org.springframework.jms.core.JmsMessagingTemplate) Test(org.junit.Test)

Example 3 with JmsMessagingTemplate

use of org.springframework.jms.core.JmsMessagingTemplate in project spring-boot by spring-projects.

the class JmsAutoConfigurationTests method testJmsTemplateBackOffEverything.

@Test
public void testJmsTemplateBackOffEverything() {
    this.context = createContext(TestConfiguration2.class, TestConfiguration3.class, TestConfiguration5.class);
    JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
    assertThat(jmsTemplate.getPriority()).isEqualTo(999);
    assertThat(this.context.getBean(ActiveMQConnectionFactory.class).getBrokerURL()).isEqualTo("foobar");
    JmsMessagingTemplate messagingTemplate = this.context.getBean(JmsMessagingTemplate.class);
    assertThat(messagingTemplate.getDefaultDestinationName()).isEqualTo("fooBar");
    assertThat(messagingTemplate.getJmsTemplate()).isEqualTo(jmsTemplate);
}
Also used : ActiveMQConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory) JmsMessagingTemplate(org.springframework.jms.core.JmsMessagingTemplate) JmsTemplate(org.springframework.jms.core.JmsTemplate) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 JmsMessagingTemplate (org.springframework.jms.core.JmsMessagingTemplate)3 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)2 JmsTemplate (org.springframework.jms.core.JmsTemplate)2