Fix Typo in DEBUG Message
Also add another control-bus test. Conflicts: spring-integration-core/src/test/java/org/springframework/integration/config/xml/ControlBusTests.java Resolved.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,14 +19,17 @@ package org.springframework.integration.config.xml;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
@@ -43,6 +46,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Gunnar Hillert
|
||||
* @author Gary Russell
|
||||
* @since 2.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@@ -58,6 +62,9 @@ public class ControlBusTests {
|
||||
@Autowired
|
||||
private DefaultHeaderChannelRegistry registry;
|
||||
|
||||
@Autowired
|
||||
private Service service;
|
||||
|
||||
@Test
|
||||
public void testDefaultEvaluationContext() {
|
||||
Message<?> message = MessageBuilder.withPayload("@service.convert('aardvark')+headers.foo").setHeader("foo", "bar").build();
|
||||
@@ -66,15 +73,24 @@ public class ControlBusTests {
|
||||
assertNull(output.receive(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testvoidOperation() throws Exception {
|
||||
Message<?> message = MessageBuilder.withPayload("@service.voidOp('foo')").build();
|
||||
this.input.send(message);
|
||||
assertTrue(this.service.latch.await(10, TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLifecycleMethods() {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("ControlBusLifecycleTests-context.xml", this.getClass());
|
||||
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"ControlBusLifecycleTests-context.xml", this.getClass());
|
||||
MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
|
||||
PollableChannel outputChannel = context.getBean("outputChannel", PollableChannel.class);
|
||||
assertNull(outputChannel.receive(1000));
|
||||
Message<?> message = MessageBuilder.withPayload("@adapter.start()").build();
|
||||
inputChannel.send(message);
|
||||
assertNotNull(outputChannel.receive(1000));
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -101,11 +117,18 @@ public class ControlBusTests {
|
||||
|
||||
public static class Service {
|
||||
|
||||
private final CountDownLatch latch = new CountDownLatch(1);
|
||||
|
||||
@ManagedOperation
|
||||
public String convert(String input) {
|
||||
return "cat";
|
||||
}
|
||||
|
||||
@ManagedOperation
|
||||
public void voidOp(String input) {
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AdapterService {
|
||||
|
||||
@@ -675,7 +675,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements BeanPostP
|
||||
logger.info("Finalized stop for component " + component + "; it reported " + n + " active messages");
|
||||
}
|
||||
}
|
||||
logger.debug("Initiated stop OrderlyShutdownCapable components");
|
||||
logger.debug("Finalized stop OrderlyShutdownCapable components");
|
||||
}
|
||||
|
||||
@ManagedMetric(metricType = MetricType.COUNTER, displayName = "MessageChannel Channel Count")
|
||||
|
||||
Reference in New Issue
Block a user