INT-1848 Add order Attribute (stream)

This commit is contained in:
Gary Russell
2011-04-30 10:56:44 -04:00
parent 7cd30025fc
commit 832b3433ee
3 changed files with 14 additions and 3 deletions

View File

@@ -68,6 +68,14 @@
<xsd:attribute name="charset" type="xsd:string"/>
<xsd:attribute name="append-newline" type="xsd:string" default="false"/>
<xsd:attribute name="auto-startup" type="xsd:string" default="true"/>
<xsd:attribute name="order">
<xsd:annotation>
<xsd:documentation>
Specifies the order for invocation when this endpoint is connected as a
subscriber to a SubscribableChannel.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:schema>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 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.
@@ -37,6 +37,7 @@ import org.springframework.integration.stream.CharacterStreamWritingMessageHandl
/**
* @author Mark Fisher
* @author Gary Russell
*/
public class ConsoleOutboundChannelAdapterParserTests {
@@ -75,6 +76,7 @@ public class ConsoleOutboundChannelAdapterParserTests {
handler.handleMessage(new GenericMessage<String>("foo"));
assertEquals("foo", out.toString());
assertEquals("", err.toString());
assertEquals(23, accessor.getPropertyValue("order"));
}
@Test
@@ -131,6 +133,7 @@ public class ConsoleOutboundChannelAdapterParserTests {
handler.handleMessage(new GenericMessage<String>("bad"));
assertEquals("", out.toString());
assertEquals("bad", err.toString());
assertEquals(34, accessor.getPropertyValue("order"));
}
@Test

View File

@@ -12,11 +12,11 @@
<integration:channel id="testChannel"/>
<stdout-channel-adapter id="stdoutAdapterWithDefaultCharset" channel="testChannel"/>
<stdout-channel-adapter id="stdoutAdapterWithDefaultCharset" channel="testChannel" order="23"/>
<stdout-channel-adapter id="stdoutAdapterWithProvidedCharset" charset="UTF-8" channel="testChannel"/>
<stderr-channel-adapter id="stderrAdapter" channel="testChannel"/>
<stderr-channel-adapter id="stderrAdapter" channel="testChannel" order="34"/>
<stdout-channel-adapter id="newlineAdapter" append-newline="true" channel="testChannel"/>