...But I do feel that this kind of test tools, even if they don't reside in the core, are quite needed,
There is an abstract class in spring-integration-test (2.1.RC1) that does (I think) exactly what you want - it abstracts the channel type and you provide a handler, regardless. See
Code:
/**
* Convenience class for testing Spring Integration request-response message scenarios. Users
* create subclasses to execute on or more {@link RequestResponseScenario} tests. each scenario defines:
* <ul>
* <li>An inputChannelName</li>
* <li>An outputChannelName</li>
* <li>A payload or message to send as a request message on the inputChannel</li>
* <li>A handler to validate the response received on the outputChannel</li>
* </ul>
* @author David Turanski
*/
@RunWith(SpringJUnit4ClassRunner.class)
public abstract class AbstractRequestResponseScenarioTests {
You extend this class - there are some examples of how to use it in src/test/java in that project. See MessageScenariosTests.
HTH
Last edited by Gary Russell; Dec 21st, 2011 at 09:13 AM.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware