INT-2275: any outbound-channel-adapter in <chain>
Add re-init logic for nested chains Add logic about nested element for AbstractChannelAdapterParser Refactor of DefaultOutboundChannelAdapterParser Test for non-last nested chain with some outbound-channel-adapter Improve XSD for chain-type Manual outbound-channel-adapter ability for chain Integration tests for all outbound-channel-adapter within <chain> Remove redundant 'return-value-required' attribute from <stored-proc-outbound-channel-adapter> Add support 'expectReply' for FileWritingMessageHandler INT-2275 polishing & refactor FileOutbound*Parser HttpRequestExecutingMessageHandlerTests polishing INT-2275: polishing JavaDoc
This commit is contained in:
committed by
Oleg Zhurakousky
parent
4d5b8d5be1
commit
45c429ee2b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +31,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.mapping.MessageMappingException;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
@@ -40,6 +41,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* @author Marius Bogoevici
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
@RunWith(value = SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = {"classpath:/org/springframework/integration/mail/mailSendingMessageHandlerContextTests.xml"})
|
||||
@@ -51,6 +53,9 @@ public class MailSendingMessageHandlerContextTests {
|
||||
@Autowired
|
||||
private StubJavaMailSender mailSender;
|
||||
|
||||
@Autowired
|
||||
private MessageChannel sendMailOutboundChainChannel;
|
||||
|
||||
|
||||
@Before
|
||||
public void reset() {
|
||||
@@ -99,4 +104,13 @@ public class MailSendingMessageHandlerContextTests {
|
||||
this.handler.handleMessage(new GenericMessage<byte[]>(payload));
|
||||
}
|
||||
|
||||
@Test //INT-2275
|
||||
public void mailOutboundChannelAdapterWithinChain() {
|
||||
this.sendMailOutboundChainChannel.send(MailTestsHelper.createIntegrationMessage());
|
||||
SimpleMailMessage mailMessage = MailTestsHelper.createSimpleMailMessage();
|
||||
assertEquals("no mime message should have been sent", 0, this.mailSender.getSentMimeMessages().size());
|
||||
assertEquals("only one simple message must be sent", 1, this.mailSender.getSentSimpleMailMessages().size());
|
||||
assertEquals("message content different from expected", mailMessage, this.mailSender.getSentSimpleMailMessages().get(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<?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:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util
|
||||
http://www.springframework.org/schema/util/spring-util.xsd">
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
|
||||
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 http://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd">
|
||||
|
||||
<bean id="javaMailSender" class="org.springframework.integration.mail.StubJavaMailSender">
|
||||
<constructor-arg>
|
||||
<bean class="javax.mail.internet.MimeMessage">
|
||||
<constructor-arg type="javax.mail.Session"><null/></constructor-arg>
|
||||
<constructor-arg type="javax.mail.Session">
|
||||
<null/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
@@ -19,4 +21,8 @@
|
||||
<constructor-arg ref="javaMailSender"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
<int:chain input-channel="sendMailOutboundChainChannel">
|
||||
<int-mail:outbound-channel-adapter mail-sender="javaMailSender"/>
|
||||
</int:chain>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user