diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/spring-integration-1.0.xsd b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/spring-integration-1.0.xsd index 0e43b530df..b06018c1b8 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/spring-integration-1.0.xsd +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/spring-integration-1.0.xsd @@ -110,9 +110,8 @@ - Defines a Publish-Subscribe channel that - broadcasts messages to its - subscribers. + Defines a Publish-Subscribe channel that + broadcasts messages to its subscribers. @@ -153,7 +152,29 @@ - + + + + Defines a channel that maintains its Messages + on a thread-bound queue. + + + + + + + + + + + + + + + + + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/threadLocalChannelParserTests.xml b/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests-context.xml similarity index 63% rename from org.springframework.integration/src/test/java/org/springframework/integration/channel/config/threadLocalChannelParserTests.xml rename to org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests-context.xml index f14e9d6f11..1723cb1030 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/threadLocalChannelParserTests.xml +++ b/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests-context.xml @@ -7,6 +7,14 @@ http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-1.0.xsd"> - + + + + + + + + + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests.java index 6d9f3f1d35..7cfd2e762e 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/channel/config/ThreadLocalChannelParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 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. @@ -19,22 +19,44 @@ package org.springframework.integration.channel.config; import static org.junit.Assert.assertEquals; import org.junit.Test; +import org.junit.runner.RunWith; -import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.integration.channel.ThreadLocalChannel; +import org.springframework.integration.config.TestChannelInterceptor; import org.springframework.integration.core.MessageChannel; +import org.springframework.integration.message.StringMessage; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Mark Fisher */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration public class ThreadLocalChannelParserTests { + @Autowired @Qualifier("simpleChannel") + private MessageChannel simpleChannel; + + @Autowired @Qualifier("channelWithInterceptor") + private MessageChannel channelWithInterceptor; + + @Autowired + private TestChannelInterceptor interceptor; + + @Test - public void testChannelType() { - ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( - "threadLocalChannelParserTests.xml", ThreadLocalChannelParserTests.class); - MessageChannel channel = (MessageChannel) context.getBean("channel"); - assertEquals(ThreadLocalChannel.class, channel.getClass()); + public void checkType() { + assertEquals(ThreadLocalChannel.class, simpleChannel.getClass()); + } + + @Test + public void verifyInterceptor() { + assertEquals(0, interceptor.getSendCount()); + channelWithInterceptor.send(new StringMessage("test")); + assertEquals(1, interceptor.getSendCount()); } }