Added SourcePollingChannelAdapterFactoryBean. The 'poller' element is now required for inbound-channel-adapter elements unless a default poller has been configured.

This commit is contained in:
Mark Fisher
2008-11-25 04:10:17 +00:00
parent 2bcab9c2df
commit d28414d2c3
4 changed files with 144 additions and 28 deletions

View File

@@ -94,15 +94,17 @@ public class ChannelAdapterParserTests extends AbstractJUnit4SpringContextTests
@Test
public void methodInvokingSource() {
String beanName = "methodInvokingSource";
PollableChannel channel = (PollableChannel) this.applicationContext.getBean("queueChannel");
PollableChannel channel = (PollableChannel) this.applicationContext.getBean("queueChannel");
TestBean testBean = (TestBean) this.applicationContext.getBean("testBean");
testBean.store("source test");
Object adapter = this.applicationContext.getBean(beanName);
assertNotNull(adapter);
assertTrue(adapter instanceof SourcePollingChannelAdapter);
((SourcePollingChannelAdapter) adapter).start();
Message<?> message = channel.receive(1000);
assertNotNull(message);
assertEquals("source test", testBean.getMessage());
((SourcePollingChannelAdapter) adapter).stop();
}
@Test(expected = ChannelResolutionException.class)