INT-1708, INT-1709 added test to make sure that 'errorChannel' header takes precedence over 'error-channel' attribute
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -17,9 +17,19 @@
|
||||
<int:poller fixed-rate="1000"/>
|
||||
</int:inbound-channel-adapter>
|
||||
|
||||
<int:inbound-channel-adapter id="withErrorChannelAndHeader" expression="5/0"
|
||||
channel="serviceChannel" auto-startup="false" error-channel="eChannel">
|
||||
<int:poller fixed-rate="1000"/>
|
||||
<int:header name="errorChannel" value="errChannel"/>
|
||||
</int:inbound-channel-adapter>
|
||||
|
||||
<int:channel id="serviceChannel"/>
|
||||
|
||||
<int:channel id="eChannel">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
<int:channel id="errChannel">
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
</beans>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user