Search in sources :

Example 11 with JmsListenerEndpointRegistry

use of org.springframework.jms.config.JmsListenerEndpointRegistry in project spring-framework by spring-projects.

the class EnableJmsTests method containerCanBeStarterViaTheRegistry.

@Test
@SuppressWarnings("resource")
void containerCanBeStarterViaTheRegistry() {
    ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EnableJmsAutoStartupFalseConfig.class, DefaultBean.class);
    JmsListenerContainerTestFactory factory = context.getBean(JmsListenerContainerTestFactory.class);
    MessageListenerTestContainer container = factory.getListenerContainers().get(0);
    assertThat(container.isAutoStartup()).isFalse();
    assertThat(container.isStarted()).isFalse();
    JmsListenerEndpointRegistry registry = context.getBean(JmsListenerEndpointRegistry.class);
    registry.start();
    assertThat(container.isStarted()).isTrue();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) JmsListenerEndpointRegistry(org.springframework.jms.config.JmsListenerEndpointRegistry) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) MessageListenerTestContainer(org.springframework.jms.config.MessageListenerTestContainer) JmsListenerContainerTestFactory(org.springframework.jms.config.JmsListenerContainerTestFactory) Test(org.junit.jupiter.api.Test)

Aggregations

JmsListenerEndpointRegistry (org.springframework.jms.config.JmsListenerEndpointRegistry)11 MessageListenerContainer (org.springframework.jms.listener.MessageListenerContainer)8 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)4 Test (org.junit.Test)4 Scheduled (org.springframework.scheduling.annotation.Scheduled)4 IOException (java.io.IOException)3 ConfigurationHelper (org.finra.herd.core.helper.ConfigurationHelper)3 JmsListenerContainerTestFactory (org.springframework.jms.config.JmsListenerContainerTestFactory)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ArrayList (java.util.ArrayList)1 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)1 Test (org.junit.jupiter.api.Test)1 ListableBeanFactory (org.springframework.beans.factory.ListableBeanFactory)1 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1 JmsListenerEndpoint (org.springframework.jms.config.JmsListenerEndpoint)1 MessageListenerTestContainer (org.springframework.jms.config.MessageListenerTestContainer)1 MethodJmsListenerEndpoint (org.springframework.jms.config.MethodJmsListenerEndpoint)1 SimpleJmsListenerEndpoint (org.springframework.jms.config.SimpleJmsListenerEndpoint)1 ListenerExecutionFailedException (org.springframework.jms.listener.adapter.ListenerExecutionFailedException)1