INT-2299
put back 'channel-resolver' attribute with deprecation warnings INT-2299 polishing INT-2299 added XPATH test
This commit is contained in:
committed by
Mark Fisher
parent
052c325dfa
commit
0a8b348c98
@@ -21,7 +21,7 @@
|
||||
</channel>
|
||||
|
||||
<channel id="routingChannel" />
|
||||
<payload-type-router input-channel="routingChannel">
|
||||
<payload-type-router id="routerWithChannelResolver" input-channel="routingChannel" channel-resolver="cr">
|
||||
<mapping type="java.lang.String" channel="channel1" />
|
||||
<mapping type="java.lang.Integer" channel="channel2" />
|
||||
<mapping type="java.lang.Number[]" channel="channel3" />
|
||||
@@ -32,4 +32,5 @@
|
||||
service-interface="org.springframework.integration.router.config.PayloadTypeRouterParserTests$TestService"
|
||||
default-request-channel="routingChannel" />
|
||||
|
||||
<beans:bean id="cr" class="org.springframework.integration.router.config.PayloadTypeRouterParserTests.MyChannelResolver"/>
|
||||
</beans:beans>
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.router.config;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -31,10 +29,16 @@ import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.endpoint.EventDrivenConsumer;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.integration.support.channel.BeanFactoryChannelResolver;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
@@ -67,6 +71,9 @@ public class PayloadTypeRouterParserTests {
|
||||
assertTrue(chanel2.receive(100).getPayload() instanceof Integer);
|
||||
assertTrue(chanel3.receive(100).getPayload().getClass().isArray());
|
||||
assertTrue(chanel4.receive(100).getPayload().getClass().isArray());
|
||||
|
||||
EventDrivenConsumer edc = context.getBean("routerWithChannelResolver", EventDrivenConsumer.class);
|
||||
assertEquals(context.getBean("cr"), TestUtils.getPropertyValue(edc, "handler.channelResolver"));
|
||||
}
|
||||
|
||||
@Test(expected=BeanDefinitionStoreException.class)
|
||||
@@ -110,4 +117,5 @@ public class PayloadTypeRouterParserTests {
|
||||
public void foo(Message<?> message);
|
||||
}
|
||||
|
||||
public static class MyChannelResolver extends BeanFactoryChannelResolver{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user