diff --git a/org.springframework.integration.adapter/.classpath b/org.springframework.integration.adapter/.classpath
index d3d76cb202..72afa3ce4c 100644
--- a/org.springframework.integration.adapter/.classpath
+++ b/org.springframework.integration.adapter/.classpath
@@ -1,17 +1,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.event/.classpath b/org.springframework.integration.event/.classpath
index d3d76cb202..72afa3ce4c 100644
--- a/org.springframework.integration.event/.classpath
+++ b/org.springframework.integration.event/.classpath
@@ -1,17 +1,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.file/.classpath b/org.springframework.integration.file/.classpath
index 4164d765a6..0ed5a603da 100644
--- a/org.springframework.integration.file/.classpath
+++ b/org.springframework.integration.file/.classpath
@@ -1,23 +1,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.http/.classpath b/org.springframework.integration.http/.classpath
index 382ee58a3b..a6a7a8b193 100644
--- a/org.springframework.integration.http/.classpath
+++ b/org.springframework.integration.http/.classpath
@@ -1,26 +1,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.http/ivy.xml b/org.springframework.integration.http/ivy.xml
index 21ddd0e8c2..8b632bcf73 100644
--- a/org.springframework.integration.http/ivy.xml
+++ b/org.springframework.integration.http/ivy.xml
@@ -28,7 +28,8 @@
-
+
+
diff --git a/org.springframework.integration.http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java b/org.springframework.integration.http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java
index 30f4bc17f2..e328361734 100644
--- a/org.springframework.integration.http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java
+++ b/org.springframework.integration.http/src/test/java/org/springframework/integration/http/config/HttpInboundGatewayParserTests.java
@@ -16,14 +16,11 @@
package org.springframework.integration.http.config;
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.*;
-import static org.springframework.integration.util.TestUtils.*;
-
-import javax.servlet.http.HttpServletResponse;
-
+import static org.hamcrest.CoreMatchers.any;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
import org.junit.Test;
-
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -31,11 +28,15 @@ import org.springframework.integration.channel.SubscribableChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.http.HttpInboundEndpoint;
+import static org.springframework.integration.test.util.TestUtils.getPropertyValue;
+import static org.springframework.integration.test.util.TestUtils.handlerExpecting;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import javax.servlet.http.HttpServletResponse;
+
/**
* @author Mark Fisher
* @author Iwein Fuld
diff --git a/org.springframework.integration.http/src/test/java/org/springframework/integration/util/TestUtils.java b/org.springframework.integration.http/src/test/java/org/springframework/integration/util/TestUtils.java
deleted file mode 100644
index e180864fbe..0000000000
--- a/org.springframework.integration.http/src/test/java/org/springframework/integration/util/TestUtils.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2002-2008 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.util;
-
-import static org.junit.Assert.assertThat;
-
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.springframework.beans.DirectFieldAccessor;
-import org.springframework.integration.core.Message;
-import org.springframework.integration.message.MessageHandler;
-import org.springframework.util.Assert;
-
-/**
- * This is a utitily class for tests with convenience methods needed in this
- * project
- *
- * Since there cannot be inter project dependencies on test code this utility
- * class is copied around. This practice should be deprecated when there is a
- * test project.
- *
- * @author Mark Fisher
- * @author Iwein Fuld
- */
-public abstract class TestUtils {
-
- public static Object getPropertyValue(Object root, String propertyPath) {
- Object value = null;
- DirectFieldAccessor accessor = new DirectFieldAccessor(root);
- String[] tokens = propertyPath.split("\\.");
- for (int i = 0; i < tokens.length; i++) {
- value = accessor.getPropertyValue(tokens[i]);
- if (value != null) {
- accessor = new DirectFieldAccessor(value);
- }
- else if (i == tokens.length - 1) {
- return null;
- }
- else {
- throw new IllegalArgumentException("intermediate property '"
- + tokens[i] + "' is null");
- }
- }
- return value;
- }
-
- @SuppressWarnings("unchecked")
- public static T getPropertyValue(Object root, String propertyPath,
- Class type) {
- Object value = getPropertyValue(root, propertyPath);
- Assert.isAssignable(type, value.getClass());
- return (T) value;
- }
-
- @SuppressWarnings("unchecked")
- public static MessageHandler handlerExpecting(
- final Matcher expectation) {
- return new MessageHandler() {
- public void handleMessage(Message> message) {
- assertThat(message, expectation);
- }
- };
- }
-
- public static Matcher> messageWithPayload(final Object payload) {
- return new BaseMatcher>() {
-
- public boolean matches(Object candidate) {
- return ((Message>) candidate).getPayload().equals(payload);
- }
-
- public void describeTo(Description description) {
- description.appendText("A message with payload: " + payload);
- }
- };
- }
-}
diff --git a/org.springframework.integration.httpinvoker/.classpath b/org.springframework.integration.httpinvoker/.classpath
index d0c2440d62..86b6c5aa14 100644
--- a/org.springframework.integration.httpinvoker/.classpath
+++ b/org.springframework.integration.httpinvoker/.classpath
@@ -1,23 +1,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.jms/.classpath b/org.springframework.integration.jms/.classpath
index f3d48c201d..abbed6ec96 100644
--- a/org.springframework.integration.jms/.classpath
+++ b/org.springframework.integration.jms/.classpath
@@ -1,22 +1,23 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.mail/.classpath b/org.springframework.integration.mail/.classpath
index 5212ba1598..35c0a4c170 100644
--- a/org.springframework.integration.mail/.classpath
+++ b/org.springframework.integration.mail/.classpath
@@ -1,25 +1,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.rmi/.classpath b/org.springframework.integration.rmi/.classpath
index 7a3fcfa897..b936e3abfe 100644
--- a/org.springframework.integration.rmi/.classpath
+++ b/org.springframework.integration.rmi/.classpath
@@ -1,21 +1,22 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.security/.classpath b/org.springframework.integration.security/.classpath
index 1f3726acfe..80c53673a3 100644
--- a/org.springframework.integration.security/.classpath
+++ b/org.springframework.integration.security/.classpath
@@ -1,23 +1,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.stream/.classpath b/org.springframework.integration.stream/.classpath
index 21f9a2f7fb..6bc64653d2 100644
--- a/org.springframework.integration.stream/.classpath
+++ b/org.springframework.integration.stream/.classpath
@@ -1,18 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.test/.classpath b/org.springframework.integration.test/.classpath
index 1d4d1cad2e..d0ad05d0e4 100644
--- a/org.springframework.integration.test/.classpath
+++ b/org.springframework.integration.test/.classpath
@@ -1,55 +1,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration.test/src/main/java/org/springframework/integration/test/util/TestUtils.java b/org.springframework.integration.test/src/main/java/org/springframework/integration/test/util/TestUtils.java
index 7ca842b3ca..bd8368d41c 100644
--- a/org.springframework.integration.test/src/main/java/org/springframework/integration/test/util/TestUtils.java
+++ b/org.springframework.integration.test/src/main/java/org/springframework/integration/test/util/TestUtils.java
@@ -16,8 +16,9 @@
package org.springframework.integration.test.util;
-import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
-
+import static org.hamcrest.CoreMatchers.is;
+import org.hamcrest.Matcher;
+import static org.junit.Assert.assertThat;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.BeanFactory;
@@ -26,117 +27,133 @@ import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.integration.channel.BeanFactoryChannelResolver;
+import org.springframework.integration.channel.MessagePublishingErrorHandler;
import org.springframework.integration.context.IntegrationContextUtils;
+import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.AbstractPollingEndpoint;
-import org.springframework.scheduling.TaskScheduler;
+import org.springframework.integration.message.MessageDeliveryException;
+import org.springframework.integration.message.MessageHandler;
+import org.springframework.integration.message.MessageHandlingException;
+import org.springframework.integration.message.MessageRejectedException;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import org.springframework.scheduling.support.ErrorHandler;
import org.springframework.scheduling.support.PeriodicTrigger;
import org.springframework.util.Assert;
+import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
+
/**
* @author Mark Fisher
+ * @author Iwein Fuld
*/
public abstract class TestUtils {
- public static Object getPropertyValue(Object root, String propertyPath) {
- Object value = null;
- DirectFieldAccessor accessor = new DirectFieldAccessor(root);
- String[] tokens = propertyPath.split("\\.");
- for (int i = 0; i < tokens.length; i++) {
- value = accessor.getPropertyValue(tokens[i]);
- if (value != null) {
- accessor = new DirectFieldAccessor(value);
- }
- else if (i == tokens.length - 1) {
- return null;
- }
- else {
- throw new IllegalArgumentException(
- "intermediate property '" + tokens[i] + "' is null");
- }
- }
- return value;
- }
+ public static Object getPropertyValue(Object root, String propertyPath) {
+ Object value = null;
+ DirectFieldAccessor accessor = new DirectFieldAccessor(root);
+ String[] tokens = propertyPath.split("\\.");
+ for (int i = 0; i < tokens.length; i++) {
+ value = accessor.getPropertyValue(tokens[i]);
+ if (value != null) {
+ accessor = new DirectFieldAccessor(value);
+ } else if (i == tokens.length - 1) {
+ return null;
+ } else {
+ throw new IllegalArgumentException(
+ "intermediate property '" + tokens[i] + "' is null");
+ }
+ }
+ return value;
+ }
- @SuppressWarnings("unchecked")
- public static T getPropertyValue(Object root, String propertyPath, Class type) {
- Object value = getPropertyValue(root, propertyPath);
- Assert.isAssignable(type, value.getClass());
- return (T) value;
- }
+ @SuppressWarnings("unchecked")
+ public static T getPropertyValue(Object root, String propertyPath, Class type) {
+ Object value = getPropertyValue(root, propertyPath);
+ Assert.isAssignable(type, value.getClass());
+ return (T) value;
+ }
- public static TestApplicationContext createTestApplicationContext() {
- TestApplicationContext context = new TestApplicationContext();
- registerBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, createTaskScheduler(10), context);
- return context;
- }
+ public static TestApplicationContext createTestApplicationContext() {
+ TestApplicationContext context = new TestApplicationContext();
+ ErrorHandler errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(context));
+ ThreadPoolTaskScheduler scheduler = createTaskScheduler(10);
+ scheduler.setErrorHandler(errorHandler);
+ registerBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, scheduler, context);
+ return context;
+ }
- public static TaskScheduler createTaskScheduler(int poolSize) {
- ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
- scheduler.setPoolSize(poolSize);
- scheduler.setRejectedExecutionHandler(new CallerRunsPolicy());
- scheduler.afterPropertiesSet();
- return scheduler;
- }
+ public static ThreadPoolTaskScheduler createTaskScheduler(int poolSize) {
+ ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
+ scheduler.setPoolSize(poolSize);
+ scheduler.setRejectedExecutionHandler(new CallerRunsPolicy());
+ scheduler.afterPropertiesSet();
+ return scheduler;
+ }
- private static void registerBean(String beanName, Object bean, BeanFactory beanFactory) {
- Assert.notNull(beanName, "bean name must not be null");
- ConfigurableListableBeanFactory configurableListableBeanFactory = null;
- if (beanFactory instanceof ConfigurableListableBeanFactory) {
- configurableListableBeanFactory = (ConfigurableListableBeanFactory) beanFactory;
- }
- else if (beanFactory instanceof GenericApplicationContext) {
- configurableListableBeanFactory = ((GenericApplicationContext) beanFactory).getBeanFactory();
- }
- if (bean instanceof BeanNameAware) {
- ((BeanNameAware) bean).setBeanName(beanName);
- }
- if (bean instanceof BeanFactoryAware) {
- ((BeanFactoryAware) bean).setBeanFactory(beanFactory);
- }
- if (bean instanceof InitializingBean) {
- try {
- ((InitializingBean) bean).afterPropertiesSet();
- }
- catch (Exception e) {
- throw new FatalBeanException("failed to register bean with test context", e);
- }
- }
- configurableListableBeanFactory.registerSingleton(beanName, bean);
- }
+ private static void registerBean(String beanName, Object bean, BeanFactory beanFactory) {
+ Assert.notNull(beanName, "bean name must not be null");
+ ConfigurableListableBeanFactory configurableListableBeanFactory = null;
+ if (beanFactory instanceof ConfigurableListableBeanFactory) {
+ configurableListableBeanFactory = (ConfigurableListableBeanFactory) beanFactory;
+ } else if (beanFactory instanceof GenericApplicationContext) {
+ configurableListableBeanFactory = ((GenericApplicationContext) beanFactory).getBeanFactory();
+ }
+ if (bean instanceof BeanNameAware) {
+ ((BeanNameAware) bean).setBeanName(beanName);
+ }
+ if (bean instanceof BeanFactoryAware) {
+ ((BeanFactoryAware) bean).setBeanFactory(beanFactory);
+ }
+ if (bean instanceof InitializingBean) {
+ try {
+ ((InitializingBean) bean).afterPropertiesSet();
+ }
+ catch (Exception e) {
+ throw new FatalBeanException("failed to register bean with test context", e);
+ }
+ }
+ configurableListableBeanFactory.registerSingleton(beanName, bean);
+ }
- public static class TestApplicationContext extends GenericApplicationContext {
+ public static class TestApplicationContext extends GenericApplicationContext {
- private TestApplicationContext() {
- super();
- }
+ private TestApplicationContext() {
+ super();
+ }
- public void registerChannel(String channelName, MessageChannel channel) {
- if (channel.getName() != null) {
- if (channelName == null) {
- Assert.notNull(channel.getName(), "channel name must not be null");
- channelName = channel.getName();
- }
- else {
- Assert.isTrue(channel.getName().equals(channelName),
- "channel name has already been set with a conflicting value");
- }
- }
- registerBean(channelName, channel, this);
- }
+ public void registerChannel(String channelName, MessageChannel channel) {
+ if (channel.getName() != null) {
+ if (channelName == null) {
+ Assert.notNull(channel.getName(), "channel name must not be null");
+ channelName = channel.getName();
+ } else {
+ Assert.isTrue(channel.getName().equals(channelName),
+ "channel name has already been set with a conflicting value");
+ }
+ }
+ registerBean(channelName, channel, this);
+ }
- public void registerEndpoint(String endpointName, AbstractEndpoint endpoint) {
- if (endpoint instanceof AbstractPollingEndpoint) {
- DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
- if (accessor.getPropertyValue("trigger") == null) {
- ((AbstractPollingEndpoint) endpoint).setTrigger(new PeriodicTrigger(10));
- }
- }
- registerBean(endpointName, endpoint, this);
- }
- }
+ public void registerEndpoint(String endpointName, AbstractEndpoint endpoint) {
+ if (endpoint instanceof AbstractPollingEndpoint) {
+ DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
+ if (accessor.getPropertyValue("trigger") == null) {
+ ((AbstractPollingEndpoint) endpoint).setTrigger(new PeriodicTrigger(10));
+ }
+ }
+ registerBean(endpointName, endpoint, this);
+ }
+ }
+ public static MessageHandler handlerExpecting(final Matcher messageMatcher) {
+ return new MessageHandler() {
+ public void handleMessage(Message> message) throws MessageRejectedException, MessageHandlingException, MessageDeliveryException {
+ assertThat(message, is(messageMatcher));
+ }
+ };
+ }
}
diff --git a/org.springframework.integration.ws/.classpath b/org.springframework.integration.ws/.classpath
index adc56bb6cb..7e4b677bb0 100644
--- a/org.springframework.integration.ws/.classpath
+++ b/org.springframework.integration.ws/.classpath
@@ -1,27 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/org.springframework.integration.xml/.classpath b/org.springframework.integration.xml/.classpath
index 2c23eedb2e..7e4b677bb0 100644
--- a/org.springframework.integration.xml/.classpath
+++ b/org.springframework.integration.xml/.classpath
@@ -1,25 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/org.springframework.integration/.classpath b/org.springframework.integration/.classpath
index 99193ac6c2..a8a1b828b4 100644
--- a/org.springframework.integration/.classpath
+++ b/org.springframework.integration/.classpath
@@ -1,26 +1,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/org.springframework.integration/ivy.xml b/org.springframework.integration/ivy.xml
index ae396aff86..d0b8fdaa20 100644
--- a/org.springframework.integration/ivy.xml
+++ b/org.springframework.integration/ivy.xml
@@ -29,6 +29,7 @@
+
\ No newline at end of file
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java
index 330c0ef7d8..6f23bfa07b 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java
@@ -30,7 +30,7 @@ import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.message.MessageBuilder;
-import org.springframework.integration.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
/**
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java
index 813508f880..951fab0633 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/ApplicationContextMessageBusTests.java
@@ -16,16 +16,8 @@
package org.springframework.integration.bus;
-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.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
+import static org.junit.Assert.*;
import org.junit.Test;
-
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.channel.PublishSubscribeChannel;
@@ -37,15 +29,14 @@ import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
import org.springframework.integration.handler.ReplyMessageHolder;
-import org.springframework.integration.message.ErrorMessage;
-import org.springframework.integration.message.GenericMessage;
-import org.springframework.integration.message.MessageBuilder;
-import org.springframework.integration.message.MessageSource;
-import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.message.*;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
import org.springframework.scheduling.support.PeriodicTrigger;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
/**
* @author Mark Fisher
*/
@@ -192,7 +183,7 @@ public class ApplicationContextMessageBusTests {
latch.await(2000, TimeUnit.MILLISECONDS);
Message> message = errorChannel.receive(5000);
context.stop();
- assertNull(outputChannel.receive(0));
+ assertNull(outputChannel.receive(100));
assertNotNull("message should not be null", message);
assertTrue(message instanceof ErrorMessage);
Throwable exception = ((ErrorMessage) message).getPayload();
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java
index 16f1039a5c..0a6e935956 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java
@@ -35,8 +35,8 @@ import org.springframework.integration.handler.AbstractReplyProducingMessageHand
import org.springframework.integration.handler.ReplyMessageHolder;
import org.springframework.integration.handler.ServiceActivatingHandler;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
/**
* @author Mark Fisher
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml b/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml
index a27ed488dc..23a1ce9dfe 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml
@@ -1,17 +1,17 @@
-
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-
+
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java
index 36110a2292..42742f6227 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/channel/MessageChannelTemplateTests.java
@@ -37,8 +37,8 @@ import org.springframework.integration.handler.AbstractReplyProducingMessageHand
import org.springframework.integration.handler.ReplyMessageHolder;
import org.springframework.integration.message.MessageBuilder;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
import org.springframework.scheduling.support.PeriodicTrigger;
/**
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java
index b0e1bff6bf..a566b65c5c 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java
@@ -38,7 +38,7 @@ import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.message.MessageBuilder;
import org.springframework.integration.util.MethodInvoker;
-import org.springframework.integration.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils;
/**
* @author Marius Bogoevici
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java
index 375c4a978c..dc51abb80c 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java
@@ -19,7 +19,7 @@ package org.springframework.integration.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.springframework.integration.util.TestUtils.getPropertyValue;
+import static org.springframework.integration.test.util.TestUtils.getPropertyValue;
import java.util.ArrayList;
import java.util.List;
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java
index 28f5ae2d20..e32816256a 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/ServiceActivatorAnnotationPostProcessorTests.java
@@ -31,8 +31,8 @@ import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
/**
* @author Mark Fisher
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java
index 7ef88b797a..eda5dcc0c3 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/SourcePollingChannelAdapterFactoryBeanTests.java
@@ -34,8 +34,8 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.message.MessageSource;
import org.springframework.integration.message.StringMessage;
import org.springframework.integration.scheduling.PollerMetadata;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
import org.springframework.scheduling.support.PeriodicTrigger;
import org.springframework.util.ClassUtils;
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java
index ab5881ac94..2e4ec0b81c 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java
@@ -21,7 +21,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.springframework.integration.util.TestUtils.getPropertyValue;
+import static org.springframework.integration.test.util.TestUtils.getPropertyValue;
import java.lang.reflect.Method;
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java
index ebfe5c9954..ad2f349554 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java
@@ -41,8 +41,8 @@ import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.message.MessageBuilder;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
/**
* @author Mark Fisher
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java
index 18dcae80da..61b6e1a955 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessorTests.java
@@ -27,8 +27,8 @@ import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
/**
* @author Mark Fisher
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java
index 2d2736653b..ffb5477eca 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessorTests.java
@@ -29,8 +29,8 @@ import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.message.StringMessage;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
/**
* @author Mark Fisher
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/gateway/SimpleMessagingGatewayTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/gateway/SimpleMessagingGatewayTests.java
index f5e5aa84ea..7b67e33c1e 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/gateway/SimpleMessagingGatewayTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/gateway/SimpleMessagingGatewayTests.java
@@ -16,27 +16,19 @@
package org.springframework.integration.gateway;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.getCurrentArguments;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
+import static org.easymock.EasyMock.*;
+import org.easymock.IAnswer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-
-import org.easymock.IAnswer;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-
import org.springframework.integration.channel.PollableChannel;
import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.core.MessageHeaders;
import org.springframework.integration.message.MessageDeliveryException;
-import org.springframework.integration.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils;
/**
* @author Iwein Fuld
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java
index d22dd8dddd..13140f7d28 100644
--- a/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java
+++ b/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingMessageHandlerTests.java
@@ -31,8 +31,8 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessagingException;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.handler.MethodInvokingMessageHandler;
-import org.springframework.integration.util.TestUtils;
-import org.springframework.integration.util.TestUtils.TestApplicationContext;
+import org.springframework.integration.test.util.TestUtils;
+import org.springframework.integration.test.util.TestUtils.TestApplicationContext;
import org.springframework.scheduling.support.PeriodicTrigger;
/**
diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/util/TestUtils.java b/org.springframework.integration/src/test/java/org/springframework/integration/util/TestUtils.java
deleted file mode 100644
index d79e12b849..0000000000
--- a/org.springframework.integration/src/test/java/org/springframework/integration/util/TestUtils.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2002-2009 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.util;
-
-import java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy;
-
-import org.springframework.beans.DirectFieldAccessor;
-import org.springframework.beans.FatalBeanException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
-import org.springframework.beans.factory.BeanNameAware;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.integration.channel.BeanFactoryChannelResolver;
-import org.springframework.integration.channel.MessagePublishingErrorHandler;
-import org.springframework.integration.context.IntegrationContextUtils;
-import org.springframework.integration.core.MessageChannel;
-import org.springframework.integration.endpoint.AbstractEndpoint;
-import org.springframework.integration.endpoint.AbstractPollingEndpoint;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
-import org.springframework.scheduling.support.ErrorHandler;
-import org.springframework.scheduling.support.PeriodicTrigger;
-import org.springframework.util.Assert;
-
-/**
- * @author Mark Fisher
- */
-public abstract class TestUtils {
-
- public static Object getPropertyValue(Object root, String propertyPath) {
- Object value = null;
- DirectFieldAccessor accessor = new DirectFieldAccessor(root);
- String[] tokens = propertyPath.split("\\.");
- for (int i = 0; i < tokens.length; i++) {
- value = accessor.getPropertyValue(tokens[i]);
- if (value != null) {
- accessor = new DirectFieldAccessor(value);
- }
- else if (i == tokens.length - 1) {
- return null;
- }
- else {
- throw new IllegalArgumentException(
- "intermediate property '" + tokens[i] + "' is null");
- }
- }
- return value;
- }
-
- @SuppressWarnings("unchecked")
- public static T getPropertyValue(Object root, String propertyPath, Class type) {
- Object value = getPropertyValue(root, propertyPath);
- Assert.isAssignable(type, value.getClass());
- return (T) value;
- }
-
- public static TestApplicationContext createTestApplicationContext() {
- TestApplicationContext context = new TestApplicationContext();
- ErrorHandler errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(context));
- ThreadPoolTaskScheduler scheduler = createTaskScheduler(10);
- scheduler.setErrorHandler(errorHandler);
- registerBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, scheduler, context);
- return context;
- }
-
- public static ThreadPoolTaskScheduler createTaskScheduler(int poolSize) {
- ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
- scheduler.setPoolSize(poolSize);
- scheduler.setRejectedExecutionHandler(new CallerRunsPolicy());
- scheduler.afterPropertiesSet();
- return scheduler;
- }
-
- private static void registerBean(String beanName, Object bean, BeanFactory beanFactory) {
- Assert.notNull(beanName, "bean name must not be null");
- ConfigurableListableBeanFactory configurableListableBeanFactory = null;
- if (beanFactory instanceof ConfigurableListableBeanFactory) {
- configurableListableBeanFactory = (ConfigurableListableBeanFactory) beanFactory;
- }
- else if (beanFactory instanceof GenericApplicationContext) {
- configurableListableBeanFactory = ((GenericApplicationContext) beanFactory).getBeanFactory();
- }
- if (bean instanceof BeanNameAware) {
- ((BeanNameAware) bean).setBeanName(beanName);
- }
- if (bean instanceof BeanFactoryAware) {
- ((BeanFactoryAware) bean).setBeanFactory(beanFactory);
- }
- if (bean instanceof InitializingBean) {
- try {
- ((InitializingBean) bean).afterPropertiesSet();
- }
- catch (Exception e) {
- throw new FatalBeanException("failed to register bean with test context", e);
- }
- }
- configurableListableBeanFactory.registerSingleton(beanName, bean);
- }
-
-
- public static class TestApplicationContext extends GenericApplicationContext {
-
- private TestApplicationContext() {
- super();
- }
-
- public void registerChannel(String channelName, MessageChannel channel) {
- if (channel.getName() != null) {
- if (channelName == null) {
- Assert.notNull(channel.getName(), "channel name must not be null");
- channelName = channel.getName();
- }
- else {
- Assert.isTrue(channel.getName().equals(channelName),
- "channel name has already been set with a conflicting value");
- }
- }
- registerBean(channelName, channel, this);
- }
-
- public void registerEndpoint(String endpointName, AbstractEndpoint endpoint) {
- if (endpoint instanceof AbstractPollingEndpoint) {
- DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
- if (accessor.getPropertyValue("trigger") == null) {
- ((AbstractPollingEndpoint) endpoint).setTrigger(new PeriodicTrigger(10));
- }
- }
- registerBean(endpointName, endpoint, this);
- }
- }
-
-}
diff --git a/spring-integration-samples/cafe/.classpath b/spring-integration-samples/cafe/.classpath
index 96489ff1c9..ef0aa1d935 100644
--- a/spring-integration-samples/cafe/.classpath
+++ b/spring-integration-samples/cafe/.classpath
@@ -1,10 +1,10 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+