コード例 #1
0
 @Test
 public void testActiveMQOverriddenPoolAndStandalone() {
   load(TestConfiguration.class, "spring.activemq.pooled:true", "spring.activemq.inMemory:false");
   JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
   PooledConnectionFactory pool = this.context.getBean(PooledConnectionFactory.class);
   assertThat(jmsTemplate).isNotNull();
   assertThat(pool).isNotNull();
   assertThat(pool).isEqualTo(jmsTemplate.getConnectionFactory());
   ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool.getConnectionFactory();
   assertThat(factory.getBrokerURL()).isEqualTo(ACTIVEMQ_NETWORK_URL);
 }
コード例 #2
0
 @Test
 public void testActiveMQOverriddenPoolAndRemoteServer() {
   load(
       TestConfiguration.class,
       "spring.activemq.pooled:true",
       "spring.activemq.brokerUrl:tcp://remote-host:10000");
   JmsTemplate jmsTemplate = this.context.getBean(JmsTemplate.class);
   PooledConnectionFactory pool = this.context.getBean(PooledConnectionFactory.class);
   assertThat(jmsTemplate).isNotNull();
   assertThat(pool).isNotNull();
   assertThat(pool).isEqualTo(jmsTemplate.getConnectionFactory());
   ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) pool.getConnectionFactory();
   assertThat(factory.getBrokerURL()).isEqualTo("tcp://remote-host:10000");
 }