INT-1029: Support for outbound-gateways in chain
XSD refactoring: remove use="required" from 'request-channel' attribute of all 'outbound-gateways' Tests for all 'outbound-gateways' inside the <chain>
This commit is contained in:
committed by
Oleg Zhurakousky
parent
c3860e14b7
commit
5bc41bc60b
@@ -17,18 +17,23 @@
|
||||
<context:mbean-server/>
|
||||
|
||||
<si:channel id="withReplyChannel"/>
|
||||
|
||||
|
||||
<si:channel id="withReplyChannelOutput">
|
||||
<si:queue/>
|
||||
</si:channel>
|
||||
|
||||
|
||||
<si:channel id="withNoReplyChannel"/>
|
||||
|
||||
|
||||
<jmx:operation-invoking-outbound-gateway request-channel="withReplyChannel"
|
||||
reply-channel="withReplyChannelOutput"
|
||||
object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"
|
||||
operation-name="testWithReturn"/>
|
||||
|
||||
<si:chain input-channel="jmxOutboundGatewayInsideChain" output-channel="withReplyChannelOutput">
|
||||
<jmx:operation-invoking-outbound-gateway operation-name="testWithReturn"
|
||||
object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"/>
|
||||
</si:chain>
|
||||
|
||||
<jmx:operation-invoking-outbound-gateway request-channel="withNoReplyChannel"
|
||||
object-name="org.springframework.integration.jmx.config:type=TestBean,name=testBeanGateway"
|
||||
operation-name="test"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 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.
|
||||
@@ -28,12 +28,14 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
*
|
||||
* @author Artem Bilan
|
||||
*
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@@ -51,6 +53,9 @@ public class OperationInvokingOutboundGatewayTests {
|
||||
@Qualifier("withNoReplyChannel")
|
||||
private MessageChannel withNoReplyChannel;
|
||||
|
||||
@Autowired
|
||||
private MessageChannel jmxOutboundGatewayInsideChain;
|
||||
|
||||
@Autowired
|
||||
private TestBean testBean;
|
||||
|
||||
@@ -79,4 +84,14 @@ public class OperationInvokingOutboundGatewayTests {
|
||||
assertEquals(3, testBean.messages.size());
|
||||
}
|
||||
|
||||
@Test //INT-1029
|
||||
public void testOutboundGatewayInsideChain() throws Exception {
|
||||
jmxOutboundGatewayInsideChain.send(MessageBuilder.withPayload("1").build());
|
||||
assertEquals(1, ((List<?>) withReplyChannelOutput.receive().getPayload()).size());
|
||||
jmxOutboundGatewayInsideChain.send(MessageBuilder.withPayload("2").build());
|
||||
assertEquals(2, ((List<?>) withReplyChannelOutput.receive().getPayload()).size());
|
||||
jmxOutboundGatewayInsideChain.send(MessageBuilder.withPayload("3").build());
|
||||
assertEquals(3, ((List<?>) withReplyChannelOutput.receive().getPayload()).size());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user