INT-1682 added parser support for error-channel for XMPP inbound adapters
This commit is contained in:
@@ -60,6 +60,7 @@ public abstract class AbstractXmppInboundChannelAdapterParser extends AbstractSi
|
||||
}
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "channel", "outputChannel");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup");
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel");
|
||||
this.postProcess(element, parserContext, builder);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,6 +174,14 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="error-channel" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Identifies channel that error messages will be sent to if a failure occurs in this
|
||||
adapter's invocation.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="xmpp-connection" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user