Refactored channel adapter parsing to accommodate recent adapter changes.
This commit is contained in:
@@ -29,11 +29,27 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class AdapterBusTests {
|
||||
public class AdapterTests {
|
||||
|
||||
@Test
|
||||
public void testAdapters() throws IOException, InterruptedException {
|
||||
AbstractApplicationContext context = new ClassPathXmlApplicationContext("adapterBusTests.xml", this.getClass());
|
||||
public void testAdaptersWithBeanDefinitions() throws IOException, InterruptedException {
|
||||
AbstractApplicationContext context = new ClassPathXmlApplicationContext("adapterTests.xml", this.getClass());
|
||||
TestSink sink = (TestSink) context.getBean("sink");
|
||||
assertNull(sink.get());
|
||||
context.start();
|
||||
String result = null;
|
||||
int attempts = 0;
|
||||
while (result == null && attempts++ < 100) {
|
||||
Thread.sleep(5);
|
||||
result = sink.get();
|
||||
}
|
||||
assertNotNull(result);
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdaptersWithNamespace() throws IOException, InterruptedException {
|
||||
AbstractApplicationContext context = new ClassPathXmlApplicationContext("adapterTestsWithNamespace.xml", this.getClass());
|
||||
TestSink sink = (TestSink) context.getBean("sink");
|
||||
assertNull(sink.get());
|
||||
context.start();
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:si="http://www.springframework.org/schema/integration"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd">
|
||||
|
||||
<si:message-bus/>
|
||||
|
||||
<si:channel id="inputChannel"/>
|
||||
|
||||
<si:channel id="outputChannel"/>
|
||||
|
||||
<si:source-adapter ref="source" method="foo" channel="inputChannel" period="100"/>
|
||||
|
||||
<si:target-adapter ref="sink" method="store" channel="outputChannel"/>
|
||||
|
||||
<si:endpoint input-channel="inputChannel" default-output-channel="outputChannel"/>
|
||||
|
||||
<bean id="source" class="org.springframework.integration.adapter.TestSource"/>
|
||||
|
||||
<bean id="sink" class="org.springframework.integration.adapter.TestSink"/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user