test contexts

This commit is contained in:
Mark Fisher
2010-01-18 18:31:53 +00:00
parent 845a530940
commit 20b807ef0e
2 changed files with 120 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:ip="http://www.springframework.org/schema/integration/ip"
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/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/ip
http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd">
<!--
Play with the buffer size to force errors. If the checkLength property is
set and this buffer is too small, we'll throw an exception.
-->
<ip:inbound-channel-adapter id="udpReceiver"
channel="udpToStdOutChannel"
protocol="udp"
port="11111"
receive-buffer-size="500"
multicast="false"
check-length="true" />
<ip:inbound-channel-adapter id="mcUdpReceiver"
channel="udpToStdOutChannel"
protocol="udp"
port="11112"
receive-buffer-size="500"
multicast="true"
multicast-address="225.6.7.8"
check-length="true" />
<channel id="udpToStdOutChannel">
<interceptors>
<beans:ref bean="stdoutCatcher"/>
</interceptors>
</channel>
<beans:bean id="stdoutCatcher" class = "org.springframework.integration.ip.StdOutCatcher"/>
<stream:stderr-channel-adapter id="stdout" channel="udpToStdOutChannel" append-newline="true"/>
<beans:bean id="taskScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler">
<beans:property name="daemon" value="true" />
<beans:property name="poolSize" value="2" />
</beans:bean>
</beans:beans>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xmlns:ip="http://www.springframework.org/schema/integration/ip"
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/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/ip
http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd">
<stream:stdin-channel-adapter id="stdin" channel="outputChannel" >
<poller>
<interval-trigger interval="100" time-unit="MILLISECONDS"/>
</poller>
</stream:stdin-channel-adapter>
<channel id="inputChannel"/>
<channel id="outputChannel" />
<service-activator input-channel="inputChannel"
output-channel="outputChannel"
ref="testIp"
method="testIp"/>
<beans:bean id="testIp" class="org.springframework.integration.ip.TestIp"/>
<ip:outbound-channel-adapter id="udpSender" protocol="udp"
host="localhost"
port="11111"
check-length="true"
acknowledge="true"
ack-host="localhost"
ack-port="22222"
ack-timeout="5000"
channel="outputChannel"/>
<channel id="mcInputChannel"/>
<channel id="mcOutputChannel" />
<service-activator input-channel="mcInputChannel"
output-channel="mcOutputChannel"
ref="testIp"
method="testIp"/>
<ip:outbound-channel-adapter id="mcUdpSender" protocol="udp"
multicast="true"
time-to-live="2"
host="225.6.7.8"
port="11112"
check-length="true"
acknowledge="true"
ack-host="localhost"
ack-port="22223"
ack-timeout="50000"
channel="mcOutputChannel"/>
<beans:bean id="taskScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler">
<beans:property name="daemon" value="true" />
</beans:bean>
</beans:beans>