From 1e872b82eb74945d376397aabd218f62cb4325c6 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 9 Jan 2008 14:00:56 +0000 Subject: [PATCH] Renamed PointToPointChannel to SimpleChannel. --- .../integration/bus/MessageBus.java | 8 ++++---- ...tToPointChannel.java => SimpleChannel.java} | 6 +++--- .../integration/config/ChannelParser.java | 4 ++-- ...MessageEndpointAnnotationPostProcessor.java | 6 +++--- .../adapter/DefaultTargetAdapterTests.java | 4 ++-- .../adapter/PollingSourceAdapterTests.java | 10 +++++----- .../integration/adapter/adapterTests.xml | 4 ++-- .../ApplicationEventSourceAdapterTests.java | 6 +++--- .../ApplicationEventTargetAdapterTests.java | 4 ++-- .../applicationEventSourceAdapterTests.xml | 2 +- .../aop/MessagePublishingInterceptorTests.java | 8 ++++---- .../aop/PublisherAnnotationAdvisorTests.java | 6 +++--- .../publisherAnnotationPostProcessorTests.xml | 2 +- .../bus/FixedDelayConsumerTests.java | 6 +++--- .../bus/FixedRateConsumerTests.java | 6 +++--- .../integration/bus/MessageBusTests.java | 16 ++++++++-------- .../bus/UnicastMessageDispatcherTests.java | 4 ++-- .../integration/bus/messageBusTests.xml | 4 ++-- ...annelTests.java => SimpleChannelTests.java} | 16 ++++++++-------- .../endpoint/GenericMessageEndpointTests.java | 10 +++++----- ...tatedEndpointWithAutoCreateChannelTests.xml | 2 +- .../router/MultiChannelRouterTests.java | 10 +++++----- .../router/PayloadTypeRouterTests.java | 10 +++++----- .../router/RecipientListRouterTests.java | 18 +++++++++--------- .../RouterMessageHandlerAdapterTests.java | 14 +++++++------- .../router/SingleChannelRouterTests.java | 8 ++++---- 26 files changed, 97 insertions(+), 97 deletions(-) rename spring-integration-core/src/main/java/org/springframework/integration/channel/{PointToPointChannel.java => SimpleChannel.java} (96%) rename spring-integration-core/src/test/java/org/springframework/integration/channel/{PointToPointChannelTests.java => SimpleChannelTests.java} (91%) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java b/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java index 3f5c0ac31b..4e95990a40 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/bus/MessageBus.java @@ -36,7 +36,7 @@ import org.springframework.integration.adapter.TargetAdapter; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.MessageEndpoint; import org.springframework.integration.message.ErrorMessage; import org.springframework.integration.message.MessageReceiver; @@ -157,7 +157,7 @@ public class MessageBus implements ChannelRegistry, ApplicationContextAware, Lif public void initialize() { initDispatcherExecutor(); if (this.getInvalidMessageChannel() == null) { - this.setInvalidMessageChannel(new PointToPointChannel(Integer.MAX_VALUE)); + this.setInvalidMessageChannel(new SimpleChannel(Integer.MAX_VALUE)); } } @@ -202,7 +202,7 @@ public class MessageBus implements ChannelRegistry, ApplicationContextAware, Lif if (this.autoCreateChannels) { String defaultOutputChannelName = endpoint.getDefaultOutputChannelName(); if (StringUtils.hasText(defaultOutputChannelName) && this.lookupChannel(defaultOutputChannelName) == null) { - this.registerChannel(defaultOutputChannelName, new PointToPointChannel()); + this.registerChannel(defaultOutputChannelName, new SimpleChannel()); } } } @@ -254,7 +254,7 @@ public class MessageBus implements ChannelRegistry, ApplicationContextAware, Lif if (this.logger.isInfoEnabled()) { logger.info("auto-creating channel '" + channelName + "'"); } - channel = new PointToPointChannel(); + channel = new SimpleChannel(); this.registerChannel(channelName, channel); } MessageEndpoint endpoint = this.endpoints.get(endpointName); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PointToPointChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java similarity index 96% rename from spring-integration-core/src/main/java/org/springframework/integration/channel/PointToPointChannel.java rename to spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java index f6f2fd74b6..1d1e60f75f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PointToPointChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/SimpleChannel.java @@ -30,7 +30,7 @@ import org.springframework.integration.message.Message; * * @author Mark Fisher */ -public class PointToPointChannel implements MessageChannel, BeanNameAware { +public class SimpleChannel implements MessageChannel, BeanNameAware { private static final int DEFAULT_CAPACITY = 25; @@ -41,14 +41,14 @@ public class PointToPointChannel implements MessageChannel, BeanNameAware { /** * Create a channel with the specified queue capacity. */ - public PointToPointChannel(int capacity) { + public SimpleChannel(int capacity) { queue = new LinkedBlockingQueue>(capacity); } /** * Create a channel with the default queue capacity. */ - public PointToPointChannel() { + public SimpleChannel() { this(DEFAULT_CAPACITY); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelParser.java index 6f972b31b3..230532e778 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/ChannelParser.java @@ -23,7 +23,7 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.util.StringUtils; /** @@ -39,7 +39,7 @@ public class ChannelParser implements BeanDefinitionParser { public BeanDefinition parse(Element element, ParserContext parserContext) { - RootBeanDefinition channelDef = new RootBeanDefinition(PointToPointChannel.class); + RootBeanDefinition channelDef = new RootBeanDefinition(SimpleChannel.class); channelDef.setSource(parserContext.extractSource(element)); String capacity = element.getAttribute(CAPACITY_ATTRIBUTE); if (StringUtils.hasText(capacity)) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java index 2f6f399bc0..678e8dcc2e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/MessageEndpointAnnotationPostProcessor.java @@ -47,7 +47,7 @@ import org.springframework.integration.bus.ConsumerPolicy; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.GenericMessageEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.handler.MessageHandlerChain; @@ -133,7 +133,7 @@ public class MessageEndpointAnnotationPostProcessor implements BeanPostProcessor source.setObject(bean); source.setMethod(method.getName()); PollingSourceAdapter adapter = new PollingSourceAdapter(source); - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); adapter.setChannel(channel); adapter.setPeriod(period); String channelName = beanName + "-inputChannel"; @@ -172,7 +172,7 @@ public class MessageEndpointAnnotationPostProcessor implements BeanPostProcessor target.setMethod(method.getName()); target.afterPropertiesSet(); DefaultTargetAdapter adapter = new DefaultTargetAdapter(target); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); String channelName = beanName + "-defaultOutputChannel"; messageBus.registerChannel(channelName, channel); messageBus.registerTargetAdapter(beanName + "-targetAdapter", adapter); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java index 3bcd0637c8..93fb8e1e11 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/DefaultTargetAdapterTests.java @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; import org.junit.Test; import org.springframework.integration.bus.MessageBus; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; @@ -45,7 +45,7 @@ public class DefaultTargetAdapterTests { target.setMethod("foo"); target.afterPropertiesSet(); DefaultTargetAdapter adapter = new DefaultTargetAdapter(target); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); adapter.setChannel(channel); Message message = new GenericMessage("123", "testing"); channel.send(message); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java index bb7fe6b283..20cf97fbc0 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/PollingSourceAdapterTests.java @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.junit.Test; import org.springframework.integration.MessageHandlingException; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; /** @@ -39,7 +39,7 @@ public class PollingSourceAdapterTests { @Test public void testPolledSourceSendsToChannel() { TestSource source = new TestSource("testing", 1); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); PollingSourceAdapter adapter = new PollingSourceAdapter(source); adapter.setChannel(channel); adapter.setPeriod(100); @@ -52,7 +52,7 @@ public class PollingSourceAdapterTests { @Test public void testSendTimeout() { TestSource source = new TestSource("testing", 1); - PointToPointChannel channel = new PointToPointChannel(1); + SimpleChannel channel = new SimpleChannel(1); PollingSourceAdapter adapter = new PollingSourceAdapter(source); adapter.setChannel(channel); adapter.setPeriod(500); @@ -73,7 +73,7 @@ public class PollingSourceAdapterTests { @Test public void testMultipleMessagesPerPoll() { TestSource source = new TestSource("testing", 3); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); PollingSourceAdapter adapter = new PollingSourceAdapter(source); adapter.setChannel(channel); adapter.setPeriod(1000); @@ -95,7 +95,7 @@ public class PollingSourceAdapterTests { @Test(expected=MessageHandlingException.class) public void testResultSizeExceedsLimit() { TestSource source = new TestSource("testing", 3); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); PollingSourceAdapter adapter = new PollingSourceAdapter(source); adapter.setChannel(channel); adapter.setPeriod(1000); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/adapterTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/adapter/adapterTests.xml index 0da1a1ccd5..4294c1226b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/adapterTests.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/adapterTests.xml @@ -6,9 +6,9 @@ - + - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventSourceAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventSourceAdapterTests.java index b1d20b25fe..16af096948 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventSourceAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventSourceAdapterTests.java @@ -32,7 +32,7 @@ import org.springframework.context.event.ContextStartedEvent; import org.springframework.context.event.ContextStoppedEvent; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; /** @@ -42,7 +42,7 @@ public class ApplicationEventSourceAdapterTests { @Test public void testAnyApplicationEventSentByDefault() { - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); ApplicationEventSourceAdapter adapter = new ApplicationEventSourceAdapter(); adapter.setChannel(channel); Message message1 = channel.receive(0); @@ -59,7 +59,7 @@ public class ApplicationEventSourceAdapterTests { @Test public void testOnlyConfiguredEventTypesAreSent() { - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); ApplicationEventSourceAdapter adapter = new ApplicationEventSourceAdapter(); List> eventTypes = new ArrayList>(); eventTypes.add(TestApplicationEvent1.class); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventTargetAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventTargetAdapterTests.java index 89b2d24126..ce772ec26a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventTargetAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/ApplicationEventTargetAdapterTests.java @@ -27,7 +27,7 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.StringMessage; /** @@ -43,7 +43,7 @@ public class ApplicationEventTargetAdapterTests { latch.countDown(); } }; - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); ApplicationEventTargetAdapter adapter = new ApplicationEventTargetAdapter(); adapter.setApplicationEventPublisher(publisher); adapter.setChannel(channel); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/applicationEventSourceAdapterTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/applicationEventSourceAdapterTests.xml index 26f6ce8098..429ff0da6d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/applicationEventSourceAdapterTests.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/adapter/event/applicationEventSourceAdapterTests.xml @@ -6,7 +6,7 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java index f67e434d1e..3f1b9ec003 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; /** @@ -34,7 +34,7 @@ public class MessagePublishingInterceptorTests { @Test public void testNonNullReturnValuePublishedWithDefaultChannel() { - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); MessagePublishingInterceptor interceptor = new MessagePublishingInterceptor(); interceptor.setDefaultChannel(channel); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), interceptor); @@ -46,7 +46,7 @@ public class MessagePublishingInterceptorTests { @Test public void testNullReturnValueNotPublished() { - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); MessagePublishingInterceptor interceptor = new MessagePublishingInterceptor(); interceptor.setDefaultChannel(channel); TestService proxy = (TestService) this.createProxy(new TestServiceImpl(null), interceptor); @@ -57,7 +57,7 @@ public class MessagePublishingInterceptorTests { @Test public void testVoidReturnValueNotPublished() { - MessageChannel channel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); MessagePublishingInterceptor interceptor = new MessagePublishingInterceptor(); interceptor.setDefaultChannel(channel); TestService proxy = (TestService) this.createProxy(new TestServiceImpl(null), interceptor); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java index 13b46a2862..bca2ba10d8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java @@ -26,7 +26,7 @@ import org.springframework.aop.framework.ProxyFactory; import org.springframework.integration.annotation.Publisher; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.message.Message; @@ -37,7 +37,7 @@ public class PublisherAnnotationAdvisorTests { @Test public void testPublisherAnnotation() { - final MessageChannel channel = new PointToPointChannel(); + final MessageChannel channel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("testChannel", channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); @@ -50,7 +50,7 @@ public class PublisherAnnotationAdvisorTests { @Test public void testNoPublisherAnnotation() { - final MessageChannel channel = new PointToPointChannel(); + final MessageChannel channel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("testChannel", channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/publisherAnnotationPostProcessorTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/aop/publisherAnnotationPostProcessorTests.xml index da37c291b8..b4f9cc371a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/publisherAnnotationPostProcessorTests.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/publisherAnnotationPostProcessorTests.xml @@ -6,7 +6,7 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedDelayConsumerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedDelayConsumerTests.java index 08840fe9dc..41bd615606 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedDelayConsumerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedDelayConsumerTests.java @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Test; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.GenericMessageEndpoint; import org.springframework.integration.endpoint.MessageEndpoint; import org.springframework.integration.message.Message; @@ -40,7 +40,7 @@ public class FixedDelayConsumerTests { int messagesToSend = 20; final AtomicInteger counter = new AtomicInteger(0); final CountDownLatch latch = new CountDownLatch(messagesToSend); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); MessageEndpoint endpoint = new GenericMessageEndpoint() { public void messageReceived(Message message) { counter.incrementAndGet(); @@ -74,7 +74,7 @@ public class FixedDelayConsumerTests { int messagesToSend = 20; final AtomicInteger counter = new AtomicInteger(0); final CountDownLatch latch = new CountDownLatch(messagesToSend); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); MessageEndpoint endpoint = new GenericMessageEndpoint() { public void messageReceived(Message message) { counter.incrementAndGet(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java index 2a347a5d0c..ee978b2cc2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.junit.Test; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.GenericMessageEndpoint; import org.springframework.integration.endpoint.MessageEndpoint; import org.springframework.integration.message.Message; @@ -41,7 +41,7 @@ public class FixedRateConsumerTests { int messagesToSend = 20; final AtomicInteger counter = new AtomicInteger(0); final CountDownLatch latch = new CountDownLatch(messagesToSend); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); MessageEndpoint endpoint = new GenericMessageEndpoint() { public void messageReceived(Message message) { counter.incrementAndGet(); @@ -72,7 +72,7 @@ public class FixedRateConsumerTests { int messagesToSend = 20; final AtomicInteger counter = new AtomicInteger(0); final CountDownLatch latch = new CountDownLatch(messagesToSend); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); MessageEndpoint endpoint = new GenericMessageEndpoint() { public void messageReceived(Message message) { counter.incrementAndGet(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java index b016524b68..470d5c4a6a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/MessageBusTests.java @@ -26,7 +26,7 @@ import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.adapter.SourceAdapter; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.GenericMessageEndpoint; import org.springframework.integration.message.ErrorMessage; import org.springframework.integration.message.GenericMessage; @@ -41,8 +41,8 @@ public class MessageBusTests { @Test public void testChannelsConnectedWithEndpoint() { MessageBus bus = new MessageBus(); - MessageChannel sourceChannel = new PointToPointChannel(); - MessageChannel targetChannel = new PointToPointChannel(); + MessageChannel sourceChannel = new SimpleChannel(); + MessageChannel targetChannel = new SimpleChannel(); bus.registerChannel("sourceChannel", sourceChannel); sourceChannel.send(new StringMessage("123", "test")); bus.registerChannel("targetChannel", targetChannel); @@ -59,9 +59,9 @@ public class MessageBusTests { @Test public void testChannelsWithoutEndpoint() { MessageBus bus = new MessageBus(); - MessageChannel sourceChannel = new PointToPointChannel(); + MessageChannel sourceChannel = new SimpleChannel(); sourceChannel.send(new StringMessage("123", "test")); - MessageChannel targetChannel = new PointToPointChannel(); + MessageChannel targetChannel = new SimpleChannel(); bus.registerChannel("sourceChannel", sourceChannel); bus.registerChannel("targetChannel", targetChannel); bus.start(); @@ -90,9 +90,9 @@ public class MessageBusTests { @Test public void testExactlyOneEndpointReceivesUnicastMessage() { - PointToPointChannel inputChannel = new PointToPointChannel(); - PointToPointChannel outputChannel1 = new PointToPointChannel(); - PointToPointChannel outputChannel2 = new PointToPointChannel(); + SimpleChannel inputChannel = new SimpleChannel(); + SimpleChannel outputChannel1 = new SimpleChannel(); + SimpleChannel outputChannel2 = new SimpleChannel(); GenericMessageEndpoint endpoint1 = new GenericMessageEndpoint(); endpoint1.setDefaultOutputChannelName("output1"); endpoint1.setInputChannelName("input"); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/UnicastMessageDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/UnicastMessageDispatcherTests.java index 1a3d19ca05..c84b9df8a1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/UnicastMessageDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/UnicastMessageDispatcherTests.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Test; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.endpoint.GenericMessageEndpoint; import org.springframework.integration.endpoint.MessageEndpoint; import org.springframework.integration.message.Message; @@ -55,7 +55,7 @@ public class UnicastMessageDispatcherTests { } }; ConsumerPolicy policy = new ConsumerPolicy(); - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); channel.send(new StringMessage(1, "test")); MessageRetriever retriever = new ChannelPollingMessageRetriever(channel, policy); UnicastMessageDispatcher dispatcher = new UnicastMessageDispatcher(retriever, policy); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/messageBusTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/bus/messageBusTests.xml index ca1249bab7..9a8df7c65a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/messageBusTests.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/messageBusTests.xml @@ -6,9 +6,9 @@ - + - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/PointToPointChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java similarity index 91% rename from spring-integration-core/src/test/java/org/springframework/integration/channel/PointToPointChannelTests.java rename to spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java index d4bc1c423a..0ddbf51468 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/PointToPointChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/SimpleChannelTests.java @@ -33,13 +33,13 @@ import org.springframework.integration.message.GenericMessage; /** * @author Mark Fisher */ -public class PointToPointChannelTests { +public class SimpleChannelTests { @Test public void testSimpleSendAndReceive() throws Exception { final AtomicBoolean messageReceived = new AtomicBoolean(false); final CountDownLatch latch = new CountDownLatch(1); - final PointToPointChannel channel = new PointToPointChannel(); + final SimpleChannel channel = new SimpleChannel(); new Thread(new Runnable() { public void run() { Message message = channel.receive(); @@ -58,7 +58,7 @@ public class PointToPointChannelTests { @Test public void testImmediateReceive() throws Exception { final AtomicBoolean messageReceived = new AtomicBoolean(false); - final PointToPointChannel channel = new PointToPointChannel(); + final SimpleChannel channel = new SimpleChannel(); final CountDownLatch latch1 = new CountDownLatch(1); final CountDownLatch latch2 = new CountDownLatch(1); Executor singleThreadExecutor = Executors.newSingleThreadExecutor(); @@ -96,7 +96,7 @@ public class PointToPointChannelTests { @Test public void testBlockingReceiveWithNoTimeout() throws Exception{ - final PointToPointChannel channel = new PointToPointChannel(); + final SimpleChannel channel = new SimpleChannel(); final AtomicBoolean receiveInterrupted = new AtomicBoolean(false); final CountDownLatch latch = new CountDownLatch(1); Thread t = new Thread(new Runnable() { @@ -116,7 +116,7 @@ public class PointToPointChannelTests { @Test public void testBlockingReceiveWithTimeout() throws Exception{ - final PointToPointChannel channel = new PointToPointChannel(); + final SimpleChannel channel = new SimpleChannel(); final AtomicBoolean receiveInterrupted = new AtomicBoolean(false); final CountDownLatch latch = new CountDownLatch(1); Thread t = new Thread(new Runnable() { @@ -136,7 +136,7 @@ public class PointToPointChannelTests { @Test public void testImmediateSend() { - PointToPointChannel channel = new PointToPointChannel(3); + SimpleChannel channel = new SimpleChannel(3); boolean result1 = channel.send(new GenericMessage(1, "test-1")); assertTrue(result1); boolean result2 = channel.send(new GenericMessage(2, "test-2"), 100); @@ -149,7 +149,7 @@ public class PointToPointChannelTests { @Test public void testBlockingSendWithNoTimeout() throws Exception{ - final PointToPointChannel channel = new PointToPointChannel(1); + final SimpleChannel channel = new SimpleChannel(1); boolean result1 = channel.send(new GenericMessage(1, "test-1")); assertTrue(result1); final AtomicBoolean sendInterrupted = new AtomicBoolean(false); @@ -170,7 +170,7 @@ public class PointToPointChannelTests { @Test public void testBlockingSendWithTimeout() throws Exception{ - final PointToPointChannel channel = new PointToPointChannel(1); + final SimpleChannel channel = new SimpleChannel(1); boolean result1 = channel.send(new GenericMessage(1, "test-1")); assertTrue(result1); final AtomicBoolean sendInterrupted = new AtomicBoolean(false); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/GenericMessageEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/GenericMessageEndpointTests.java index 29ee7f5166..03b0ca312c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/GenericMessageEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/GenericMessageEndpointTests.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -34,8 +34,8 @@ public class GenericMessageEndpointTests { @Test public void testDefaultReplyChannel() throws Exception { - MessageChannel channel = new PointToPointChannel(); - MessageChannel replyChannel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); + MessageChannel replyChannel = new SimpleChannel(); MessageHandler handler = new MessageHandler() { public Message handle(Message message) { return new StringMessage("123", "hello " + message.getPayload()); @@ -59,8 +59,8 @@ public class GenericMessageEndpointTests { @Test public void testExplicitReplyChannel() throws Exception { - MessageChannel channel = new PointToPointChannel(); - final MessageChannel replyChannel = new PointToPointChannel(); + MessageChannel channel = new SimpleChannel(); + final MessageChannel replyChannel = new SimpleChannel(); MessageHandler handler = new MessageHandler() { public Message handle(Message message) { return new StringMessage("123", "hello " + message.getPayload()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/simpleAnnotatedEndpointWithAutoCreateChannelTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/simpleAnnotatedEndpointWithAutoCreateChannelTests.xml index f02e95b678..eff7af7b4b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/simpleAnnotatedEndpointWithAutoCreateChannelTests.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/annotation/simpleAnnotatedEndpointWithAutoCreateChannelTests.xml @@ -10,7 +10,7 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java index 591644f769..c2030e9a2b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java @@ -28,7 +28,7 @@ import org.springframework.integration.MessagingConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -39,8 +39,8 @@ public class MultiChannelRouterTests { @Test public void testRoutingWithChannelResolver() { - final PointToPointChannel channel1 = new PointToPointChannel(); - final PointToPointChannel channel2 = new PointToPointChannel(); + final SimpleChannel channel1 = new SimpleChannel(); + final SimpleChannel channel2 = new SimpleChannel(); MultiChannelResolver channelResolver = new MultiChannelResolver() { public List resolve(Message message) { List channels = new ArrayList(); @@ -69,8 +69,8 @@ public class MultiChannelRouterTests { return new String[] {"channel1", "channel2"}; } }; - PointToPointChannel channel1 = new PointToPointChannel(); - PointToPointChannel channel2 = new PointToPointChannel(); + SimpleChannel channel1 = new SimpleChannel(); + SimpleChannel channel2 = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("channel1", channel1); channelRegistry.registerChannel("channel2", channel2); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java index 1ea88de8f6..01f808b604 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java @@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.junit.Test; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -37,8 +37,8 @@ public class PayloadTypeRouterTests { @Test public void testRoutingByPayloadType() { - PointToPointChannel stringChannel = new PointToPointChannel(); - PointToPointChannel integerChannel = new PointToPointChannel(); + SimpleChannel stringChannel = new SimpleChannel(); + SimpleChannel integerChannel = new SimpleChannel(); Map, MessageChannel> channelMappings = new ConcurrentHashMap, MessageChannel>(); channelMappings.put(String.class, stringChannel); channelMappings.put(Integer.class, integerChannel); @@ -59,8 +59,8 @@ public class PayloadTypeRouterTests { @Test public void testRoutingToDefaultChannelWhenNoTypeMatches() { - PointToPointChannel stringChannel = new PointToPointChannel(); - PointToPointChannel defaultChannel = new PointToPointChannel(); + SimpleChannel stringChannel = new SimpleChannel(); + SimpleChannel defaultChannel = new SimpleChannel(); Map, MessageChannel> channelMappings = new ConcurrentHashMap, MessageChannel>(); channelMappings.put(String.class, stringChannel); PayloadTypeRouter router = new PayloadTypeRouter(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java index e4d2745350..d244085440 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java @@ -29,7 +29,7 @@ import org.springframework.integration.MessagingConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -40,8 +40,8 @@ public class RecipientListRouterTests { @Test public void testRoutingWithChannelList() { - PointToPointChannel channel1 = new PointToPointChannel(); - PointToPointChannel channel2 = new PointToPointChannel(); + SimpleChannel channel1 = new SimpleChannel(); + SimpleChannel channel2 = new SimpleChannel(); List channels = new ArrayList(); channels.add(channel1); channels.add(channel2); @@ -60,8 +60,8 @@ public class RecipientListRouterTests { @Test public void testRoutingWithChannelNames() { - PointToPointChannel channel1 = new PointToPointChannel(); - PointToPointChannel channel2 = new PointToPointChannel(); + SimpleChannel channel1 = new SimpleChannel(); + SimpleChannel channel2 = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("channel1", channel1); channelRegistry.registerChannel("channel2", channel2); @@ -81,8 +81,8 @@ public class RecipientListRouterTests { @Test public void testRoutingToSingleChannelByName() { - PointToPointChannel channel1 = new PointToPointChannel(); - PointToPointChannel channel2 = new PointToPointChannel(); + SimpleChannel channel1 = new SimpleChannel(); + SimpleChannel channel2 = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("channel1", channel1); channelRegistry.registerChannel("channel2", channel2); @@ -101,8 +101,8 @@ public class RecipientListRouterTests { @Test(expected=MessagingConfigurationException.class) public void testConfigurationExceptionWhenBothChannelsAndNamesAreProvided() { - PointToPointChannel channel1 = new PointToPointChannel(); - PointToPointChannel channel2 = new PointToPointChannel(); + SimpleChannel channel1 = new SimpleChannel(); + SimpleChannel channel2 = new SimpleChannel(); List channels = new ArrayList(); channels.add(channel1); channels.add(channel2); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java index b692ac30ca..3b85eba46f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterMessageHandlerAdapterTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.integration.MessagingConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; @@ -45,7 +45,7 @@ public class RouterMessageHandlerAdapterTests { Map attribs = new ConcurrentHashMap(); RouterMessageHandlerAdapter adapter = new RouterMessageHandlerAdapter(testBean, fooMethod, attribs); Message message = new GenericMessage("123", "bar"); - PointToPointChannel barChannel = new PointToPointChannel(); + SimpleChannel barChannel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("bar-channel", barChannel); adapter.setChannelRegistry(channelRegistry); @@ -65,8 +65,8 @@ public class RouterMessageHandlerAdapterTests { RouterMessageHandlerAdapter adapter = new RouterMessageHandlerAdapter(testBean, fooMethod, attribs); Message message = new GenericMessage("123", "bar"); message.getHeader().setProperty("returnAddress", "baz"); - PointToPointChannel barChannel = new PointToPointChannel(); - PointToPointChannel bazChannel = new PointToPointChannel(); + SimpleChannel barChannel = new SimpleChannel(); + SimpleChannel bazChannel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("bar-channel", barChannel); channelRegistry.registerChannel("baz-channel", bazChannel); @@ -90,9 +90,9 @@ public class RouterMessageHandlerAdapterTests { Message message = new GenericMessage("123", "bar"); message.getHeader().setProperty("returnAddress", "bad"); message.getHeader().setAttribute("returnAddress", "baz"); - PointToPointChannel barChannel = new PointToPointChannel(); - PointToPointChannel badChannel = new PointToPointChannel(); - PointToPointChannel bazChannel = new PointToPointChannel(); + SimpleChannel barChannel = new SimpleChannel(); + SimpleChannel badChannel = new SimpleChannel(); + SimpleChannel bazChannel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("bar-channel", barChannel); channelRegistry.registerChannel("bad-channel", badChannel); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java index 3f58204976..0467739795 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java @@ -26,7 +26,7 @@ import org.springframework.integration.MessagingConfigurationException; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.MessageChannel; -import org.springframework.integration.channel.PointToPointChannel; +import org.springframework.integration.channel.SimpleChannel; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -37,7 +37,7 @@ public class SingleChannelRouterTests { @Test public void testRoutingWithChannelResolver() { - final PointToPointChannel channel = new PointToPointChannel(); + final SimpleChannel channel = new SimpleChannel(); ChannelResolver channelResolver = new ChannelResolver() { public MessageChannel resolve(Message message) { return channel; @@ -60,7 +60,7 @@ public class SingleChannelRouterTests { return "testChannel"; } }; - PointToPointChannel channel = new PointToPointChannel(); + SimpleChannel channel = new SimpleChannel(); ChannelRegistry channelRegistry = new DefaultChannelRegistry(); channelRegistry.registerChannel("testChannel", channel); SingleChannelRouter router = new SingleChannelRouter(); @@ -78,7 +78,7 @@ public class SingleChannelRouterTests { public void testConfiguringBothChannelResolverAndChannelNameResolverIsNotAllowed() { ChannelResolver channelResolver = new ChannelResolver() { public MessageChannel resolve(Message message) { - return new PointToPointChannel(); + return new SimpleChannel(); } }; ChannelNameResolver channelNameResolver = new ChannelNameResolver() {