INT-1257, added tests and minor modification to support MessageHistory in MAIL, JDBC, IP, HTTP modules

This commit is contained in:
Oleg Zhurakousky
2010-09-21 22:15:37 -04:00
parent fa570a4295
commit c4d31af848
15 changed files with 96 additions and 21 deletions

View File

@@ -144,6 +144,7 @@
</xsd:element>
<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:attribute name="update" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>

View File

@@ -33,6 +33,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.core.MessagingTemplate;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.history.MessageHistory;
import org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.transaction.PlatformTransactionManager;
@@ -60,6 +61,8 @@ public class JdbcPollingChannelAdapterParserTests {
setUp("pollingForMapJdbcInboundChannelAdapterTest.xml", getClass());
this.jdbcTemplate.update("insert into item values(1,'',2)");
Message<?> message = messagingTemplate.receive();
MessageHistory history = MessageHistory.read(message);
assertTrue(history.containsComponent("jdbcAdapter"));
assertNotNull("No message found ", message);
assertTrue("Wrong payload type expected instance of List", message.getPayload() instanceof List<?>);
}

View File

@@ -6,11 +6,13 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
<inbound-channel-adapter query="select * from item where status=2" channel="target"
<si:message-history/>
<inbound-channel-adapter id="jdbcAdapter" query="select * from item where status=2" channel="target"
data-source="dataSource" />
<beans:import resource="jdbcInboundChannelAdapterCommonConfig.xml" />