INT-1682 added parser support for error-channel for XMPP inbound adapters

This commit is contained in:
Oleg Zhurakousky
2010-12-13 14:38:50 -05:00
parent 76f0afef4f
commit ddd2805520
4 changed files with 13 additions and 1 deletions

View File

@@ -25,6 +25,6 @@
<channel id="xmppInbound"/>
<xmpp:inbound-channel-adapter id="xmppInboundAdapter" channel="xmppInbound"
xmpp-connection="testConnection" extract-payload="false" auto-startup="false"/>
xmpp-connection="testConnection" extract-payload="false" auto-startup="false" error-channel="errorChannel"/>
</beans:beans>

View File

@@ -25,6 +25,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.integration.xmpp.inbound.ChatMessageListeningEndpoint;
@@ -45,6 +46,8 @@ public class ChatMessageInboundChannelAdapterParserTests {
@Test
public void testInboundAdapter(){
ChatMessageListeningEndpoint adapter = context.getBean("xmppInboundAdapter", ChatMessageListeningEndpoint.class);
MessageChannel errorChannel = (MessageChannel) TestUtils.getPropertyValue(adapter, "errorChannel");
assertEquals(context.getBean("errorChannel"), errorChannel);
assertFalse(adapter.isAutoStartup());
DirectChannel channel = (DirectChannel) TestUtils.getPropertyValue(adapter, "outputChannel");
assertEquals("xmppInbound", channel.getComponentName());