RESOLVED - issue INT-574: Chain element should support aggregators mid chain as well as handlers extending AbstractReplyProducingMessageHandler

http://jira.springframework.org/browse/INT-574

test expanded for nested chain... just curious.
This commit is contained in:
Iwein Fuld
2009-02-10 13:26:59 +00:00
parent 965b5fbd0d
commit 2540d63b90
2 changed files with 17 additions and 0 deletions

View File

@@ -47,6 +47,10 @@
<chain input-channel="aggregatorInput" output-channel="output">
<aggregator ref="aggregatorBean" method="aggregate" />
<chain>
<filter ref="typeSelector" />
<service-activator ref="testHandler" />
</chain>
</chain>
<beans:bean id="aggregatorBean"

View File

@@ -70,6 +70,9 @@ public class ChainParserTests {
@Autowired
@Qualifier("beanInput")
private MessageChannel beanInput;
@Autowired
@Qualifier("aggregatorInput")
private MessageChannel aggregatorInput;
public static Message<?> successMessage = MessageBuilder.withPayload("success").build();
@@ -122,6 +125,16 @@ public class ChainParserTests {
assertThat(reply, is(successMessage));
}
@Test
@SuppressWarnings("unchecked")
public void chainNestingAndAggregation() throws Exception {
Message<?> message = MessageBuilder.withPayload("test").setCorrelationId(1).setSequenceSize(1).build();
this.aggregatorInput.send(message);
Message reply = this.output.receive(3000);
assertNotNull(reply);
assertThat((String)reply.getPayload(), is("foo"));
}
public static class StubHandler extends AbstractReplyProducingMessageHandler {
@Override