diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java index d04a9d4851..146a04c6ab 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/AbstractPollingInboundChannelAdapterParser.java @@ -22,7 +22,6 @@ import org.springframework.beans.BeanMetadataElement; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.channel.MessagePublishingErrorHandler; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel-context.xml b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel-context.xml index 93cc274774..e0fe737657 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel-context.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel-context.xml @@ -17,9 +17,19 @@ + + + + + + + + + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel.java index 96459f6bf2..3a135f0d25 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PollerWithErrorChannel.java @@ -36,7 +36,7 @@ public class PollerWithErrorChannel { SourcePollingChannelAdapter adapter = ac.getBean("withErrorHeader", SourcePollingChannelAdapter.class); adapter.start(); PollableChannel errorChannel = ac.getBean("eChannel", PollableChannel.class); - assertNotNull(errorChannel.receive(100000)); + assertNotNull(errorChannel.receive(1000)); adapter.stop(); } @@ -46,7 +46,17 @@ public class PollerWithErrorChannel { SourcePollingChannelAdapter adapter = ac.getBean("withErrorChannel", SourcePollingChannelAdapter.class); adapter.start(); PollableChannel errorChannel = ac.getBean("eChannel", PollableChannel.class); - assertNotNull(errorChannel.receive(100000)); + assertNotNull(errorChannel.receive(1000)); + adapter.stop(); + } + + @Test + public void testWithErrorChannelAndHeader() throws Exception{ + ApplicationContext ac = new ClassPathXmlApplicationContext("PollerWithErrorChannel-context.xml", this.getClass()); + SourcePollingChannelAdapter adapter = ac.getBean("withErrorChannelAndHeader", SourcePollingChannelAdapter.class); + adapter.start(); + PollableChannel errorChannel = ac.getBean("errChannel", PollableChannel.class); + assertNotNull(errorChannel.receive(1000)); adapter.stop(); }