use of org.springframework.integration.support.SmartLifecycleRoleController in project spring-integration by spring-projects.
the class XPathFilterParserTests method testParse.
@Test
public void testParse() throws Exception {
EventDrivenConsumer consumer = (EventDrivenConsumer) context.getBean("parseOnly");
assertEquals(2, TestUtils.getPropertyValue(consumer, "handler.order"));
assertEquals(123L, TestUtils.getPropertyValue(consumer, "handler.messagingTemplate.sendTimeout"));
assertEquals(-1, TestUtils.getPropertyValue(consumer, "phase"));
assertFalse(TestUtils.getPropertyValue(consumer, "autoStartup", Boolean.class));
SmartLifecycleRoleController roleController = context.getBean(SmartLifecycleRoleController.class);
@SuppressWarnings("unchecked") List<SmartLifecycle> list = (List<SmartLifecycle>) TestUtils.getPropertyValue(roleController, "lifecycles", MultiValueMap.class).get("foo");
assertThat(list, contains((SmartLifecycle) consumer));
}
use of org.springframework.integration.support.SmartLifecycleRoleController in project spring-integration by spring-projects.
the class JmsInboundGatewayParserTests method testGatewayWithContainerReference.
@Test
public void testGatewayWithContainerReference() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("inboundGatewayWithContainerReference.xml", this.getClass());
JmsMessageDrivenEndpoint gateway = context.getBean("gatewayWithContainerReference", JmsMessageDrivenEndpoint.class);
AbstractMessageListenerContainer messageListenerContainer = context.getBean("messageListenerContainer", AbstractMessageListenerContainer.class);
assertFalse(gateway.isRunning());
assertFalse(messageListenerContainer.isRunning());
SmartLifecycleRoleController roleController = context.getBean(SmartLifecycleRoleController.class);
@SuppressWarnings("unchecked") MultiValueMap<String, SmartLifecycle> lifecycles = TestUtils.getPropertyValue(roleController, "lifecycles", MultiValueMap.class);
assertTrue(lifecycles.containsKey("foo"));
assertSame(gateway, lifecycles.getFirst("foo"));
gateway.start();
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) new DirectFieldAccessor(gateway).getPropertyValue("listenerContainer");
assertEquals(messageListenerContainer, container);
assertTrue(gateway.isRunning());
assertTrue(messageListenerContainer.isRunning());
gateway.stop();
context.close();
}
use of org.springframework.integration.support.SmartLifecycleRoleController in project spring-integration by spring-projects.
the class MarshallingTransformerParserTests method testParse.
@Test
public void testParse() throws Exception {
EventDrivenConsumer consumer = (EventDrivenConsumer) appContext.getBean("parseOnly");
assertEquals(2, TestUtils.getPropertyValue(consumer, "handler.order"));
assertEquals(123L, TestUtils.getPropertyValue(consumer, "handler.messagingTemplate.sendTimeout"));
assertEquals(-1, TestUtils.getPropertyValue(consumer, "phase"));
assertFalse(TestUtils.getPropertyValue(consumer, "autoStartup", Boolean.class));
SmartLifecycleRoleController roleController = appContext.getBean(SmartLifecycleRoleController.class);
@SuppressWarnings("unchecked") List<SmartLifecycle> list = (List<SmartLifecycle>) TestUtils.getPropertyValue(roleController, "lifecycles", MultiValueMap.class).get("foo");
assertThat(list, contains((SmartLifecycle) consumer));
}
use of org.springframework.integration.support.SmartLifecycleRoleController in project spring-integration by spring-projects.
the class UnmarshallingTransformerParserTests method testParse.
@Test
public void testParse() throws Exception {
EventDrivenConsumer consumer = (EventDrivenConsumer) appContext.getBean("parseOnly");
assertEquals(2, TestUtils.getPropertyValue(consumer, "handler.order"));
assertEquals(123L, TestUtils.getPropertyValue(consumer, "handler.messagingTemplate.sendTimeout"));
assertEquals(-1, TestUtils.getPropertyValue(consumer, "phase"));
assertFalse(TestUtils.getPropertyValue(consumer, "autoStartup", Boolean.class));
SmartLifecycleRoleController roleController = appContext.getBean(SmartLifecycleRoleController.class);
@SuppressWarnings("unchecked") List<SmartLifecycle> list = (List<SmartLifecycle>) TestUtils.getPropertyValue(roleController, "lifecycles", MultiValueMap.class).get("foo");
assertThat(list, contains((SmartLifecycle) consumer));
}
use of org.springframework.integration.support.SmartLifecycleRoleController in project spring-integration by spring-projects.
the class XPathHeaderEnricherParserTests method testParse.
@Test
public void testParse() throws Exception {
EventDrivenConsumer consumer = (EventDrivenConsumer) context.getBean("parseOnly");
assertEquals(2, TestUtils.getPropertyValue(consumer, "handler.order"));
assertEquals(123L, TestUtils.getPropertyValue(consumer, "handler.messagingTemplate.sendTimeout"));
assertEquals(-1, TestUtils.getPropertyValue(consumer, "phase"));
assertFalse(TestUtils.getPropertyValue(consumer, "autoStartup", Boolean.class));
SmartLifecycleRoleController roleController = context.getBean(SmartLifecycleRoleController.class);
@SuppressWarnings("unchecked") List<SmartLifecycle> list = (List<SmartLifecycle>) TestUtils.getPropertyValue(roleController, "lifecycles", MultiValueMap.class).get("foo");
assertThat(list, contains((SmartLifecycle) consumer));
}
Aggregations