INT-1535: add auto-startup to schema, plus test

This commit is contained in:
Dave Syer
2010-10-18 11:36:21 -07:00
parent a8bedeee38
commit ad044120fc
3 changed files with 35 additions and 0 deletions

View File

@@ -193,6 +193,18 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-startup" type="xsd:string" default="true">
<xsd:annotation>
<xsd:appinfo>
<xsd:documentation>
Flag to say that the poller should start automatically on startup (default true).
</xsd:documentation>
<tool:annotation kind="ref">
<tool:expected-type type="org.springframework.integration.core.MessageChannel" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="update-sql-parameter-source-factory" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>

View File

@@ -57,6 +57,14 @@ public class JdbcPollingChannelAdapterParserTests {
private PlatformTransactionManager transactionManager;
@Test
public void testNoAutoStartupInboundChannelAdapter() {
setUp("pollingNoAutoStartupJdbcInboundChannelAdapterTest.xml", getClass());
this.jdbcTemplate.update("insert into item values(1,'',2)");
Message<?> message = messagingTemplate.receive();
assertNull("Message found ", message);
}
@Test
public void testSimpleInboundChannelAdapter() {
setUp("pollingForMapJdbcInboundChannelAdapterTest.xml", getClass());

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" auto-startup="#{systemProperties['autostart']?:false}"/>
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />
</beans:beans>