diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java index cb1892467d..2c0e03f390 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java @@ -25,8 +25,8 @@ import org.junit.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.QueueChannel; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.message.Message; /** @@ -38,7 +38,7 @@ public class PublisherAnnotationAdvisorTests { public void testPublisherAnnotation() { final QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), advisor); @@ -52,7 +52,7 @@ public class PublisherAnnotationAdvisorTests { public void testNoPublisherAnnotation() { final QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), advisor); @@ -65,7 +65,7 @@ public class PublisherAnnotationAdvisorTests { public void testPublishArguments() { final QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), advisor); @@ -83,7 +83,7 @@ public class PublisherAnnotationAdvisorTests { public void testPublishException() { final QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), advisor); @@ -106,7 +106,7 @@ public class PublisherAnnotationAdvisorTests { public void testPublishReturnValue() { final QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); PublisherAnnotationAdvisor advisor = new PublisherAnnotationAdvisor(channelRegistry); TestService proxy = (TestService) this.createProxy(new TestServiceImpl("hello world"), advisor); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java index 569e610d96..3cf7dc42bd 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java @@ -19,6 +19,7 @@ package org.springframework.integration.bus; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import java.util.concurrent.CountDownLatch; @@ -30,6 +31,7 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.context.support.GenericApplicationContext; import org.springframework.integration.channel.ChannelRegistry; +import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.PollableChannel; import org.springframework.integration.channel.PublishSubscribeChannel; import org.springframework.integration.channel.QueueChannel; @@ -49,7 +51,7 @@ import org.springframework.integration.scheduling.IntervalTrigger; public class DefaultMessageBusTests { @Test - public void testRegistrationWithInputChannelReference() { + public void endpointRegistrationWithInputChannelReference() { GenericApplicationContext context = new GenericApplicationContext(); QueueChannel sourceChannel = new QueueChannel(); QueueChannel targetChannel = new QueueChannel(); @@ -78,7 +80,7 @@ public class DefaultMessageBusTests { } @Test - public void testChannelsWithoutHandlers() { + public void channelsWithoutHandlers() { GenericApplicationContext context = new GenericApplicationContext(); DefaultMessageBus bus = new DefaultMessageBus(); bus.setApplicationContext(context); @@ -96,7 +98,7 @@ public class DefaultMessageBusTests { } @Test - public void testAutodetectionWithApplicationContext() { + public void autodetectionWithApplicationContext() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("messageBusTests.xml", this.getClass()); context.start(); PollableChannel sourceChannel = (PollableChannel) context.getBean("sourceChannel"); @@ -109,7 +111,7 @@ public class DefaultMessageBusTests { } @Test - public void testExactlyOneHandlerReceivesPointToPointMessage() { + public void exactlyOneConsumerReceivesPointToPointMessage() { GenericApplicationContext context = new GenericApplicationContext(); QueueChannel inputChannel = new QueueChannel(); QueueChannel outputChannel1 = new QueueChannel(); @@ -149,7 +151,7 @@ public class DefaultMessageBusTests { } @Test - public void testBothHandlersReceivePublishSubscribeMessage() throws InterruptedException { + public void bothConsumersReceivePublishSubscribeMessage() throws InterruptedException { GenericApplicationContext context = new GenericApplicationContext(); PublishSubscribeChannel inputChannel = new PublishSubscribeChannel(); QueueChannel outputChannel1 = new QueueChannel(); @@ -197,7 +199,7 @@ public class DefaultMessageBusTests { } @Test - public void testErrorChannelWithFailedDispatch() throws InterruptedException { + public void errorChannelWithFailedDispatch() throws InterruptedException { GenericApplicationContext context = new GenericApplicationContext(); QueueChannel errorChannel = new QueueChannel(); QueueChannel outputChannel = new QueueChannel(); @@ -224,12 +226,12 @@ public class DefaultMessageBusTests { } @Test(expected = BeanCreationException.class) - public void testMultipleMessageBusBeans() { + public void multipleMessageBusBeans() { new ClassPathXmlApplicationContext("multipleMessageBusBeans.xml", this.getClass()); } @Test - public void testErrorChannelRegistration() { + public void errorChannelRegistration() { DefaultMessageBus bus = new DefaultMessageBus(); QueueChannel errorChannel = new QueueChannel(); errorChannel.setBeanName(ChannelRegistry.ERROR_CHANNEL_NAME); @@ -238,7 +240,7 @@ public class DefaultMessageBusTests { } @Test - public void testHandlerSubscribedToErrorChannel() throws InterruptedException { + public void consumerSubscribedToErrorChannel() throws InterruptedException { GenericApplicationContext context = new GenericApplicationContext(); QueueChannel errorChannel = new QueueChannel(); errorChannel.setBeanName(ChannelRegistry.ERROR_CHANNEL_NAME); @@ -262,7 +264,25 @@ public class DefaultMessageBusTests { } @Test - public void testMessageBusAwareImpl() { + public void lookupRegisteredChannel() { + DefaultMessageBus messageBus = new DefaultMessageBus(); + QueueChannel testChannel = new QueueChannel(); + testChannel.setBeanName("testChannel"); + messageBus.registerChannel(testChannel); + MessageChannel lookedUpChannel = messageBus.lookupChannel("testChannel"); + assertNotNull(testChannel); + assertSame(testChannel, lookedUpChannel); + } + + @Test + public void lookupNonRegisteredChannel() { + DefaultMessageBus messageBus = new DefaultMessageBus(); + MessageChannel noSuchChannel = messageBus.lookupChannel("noSuchChannel"); + assertNull(noSuchChannel); + } + + @Test + public void messageBusAware() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("messageBusTests.xml", this.getClass()); TestMessageBusAwareImpl messageBusAwareBean = (TestMessageBusAwareImpl) context.getBean("messageBusAwareBean"); assertTrue(messageBusAwareBean.getMessageBus() == context.getBean("bus")); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/channel/DefaultChannelRegistryTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/channel/DefaultChannelRegistryTests.java deleted file mode 100644 index b6da5ad87c..0000000000 --- a/org.springframework.integration/src/test/java/org/springframework/integration/channel/DefaultChannelRegistryTests.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2002-2008 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.integration.channel; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; - -import org.junit.Test; - -/** - * @author Mark Fisher - */ -public class DefaultChannelRegistryTests { - - @Test - public void testLookupRegisteredChannel() { - QueueChannel testChannel = new QueueChannel(); - testChannel.setBeanName("testChannel"); - DefaultChannelRegistry registry = new DefaultChannelRegistry(); - registry.registerChannel(testChannel); - MessageChannel lookedUpChannel = registry.lookupChannel("testChannel"); - assertNotNull(testChannel); - assertSame(testChannel, lookedUpChannel); - } - - @Test - public void testLookupNonRegisteredChannel() { - DefaultChannelRegistry registry = new DefaultChannelRegistry(); - MessageChannel noSuchChannel = registry.lookupChannel("noSuchChannel"); - assertNull(noSuchChannel); - } - -} diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/channel/DefaultChannelRegistry.java b/org.springframework.integration/src/test/java/org/springframework/integration/channel/TestChannelRegistry.java similarity index 90% rename from org.springframework.integration/src/main/java/org/springframework/integration/channel/DefaultChannelRegistry.java rename to org.springframework.integration/src/test/java/org/springframework/integration/channel/TestChannelRegistry.java index b0bff79794..6a9e2aa95c 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/channel/DefaultChannelRegistry.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/channel/TestChannelRegistry.java @@ -22,11 +22,9 @@ import java.util.concurrent.ConcurrentHashMap; import org.springframework.util.Assert; /** - * A simple map-backed implementation of {@link ChannelRegistry}. - * * @author Mark Fisher */ -public class DefaultChannelRegistry implements ChannelRegistry { +public class TestChannelRegistry implements ChannelRegistry { private final Map channels = new ConcurrentHashMap(); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java index 6a5e249118..a54449e46f 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java @@ -30,8 +30,8 @@ import org.junit.Test; import org.springframework.integration.bus.DefaultMessageBus; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; import org.springframework.integration.channel.QueueChannel; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageBuilder; import org.springframework.integration.message.MessageHandlingException; @@ -106,7 +106,7 @@ public class ServiceActivatorEndpointTests { final QueueChannel replyChannel1 = new QueueChannel(); final QueueChannel replyChannel2 = new QueueChannel(); replyChannel2.setBeanName("replyChannel2"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(replyChannel2); Object handler = new Object() { @SuppressWarnings("unused") diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java index fcc7dc325c..3d9f53560f 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/MethodInvokingRouterTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.integration.annotation.Header; import org.springframework.integration.channel.ChannelRegistry; import org.springframework.integration.channel.ChannelRegistryAware; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.GenericMessage; @@ -47,7 +47,7 @@ public class MethodInvokingRouterTests { public void channelNameResolutionByPayloadConfiguredByMethodReference() throws Exception { QueueChannel barChannel = new QueueChannel(); barChannel.setBeanName("bar-channel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(barChannel); SingleChannelNameRoutingTestBean testBean = new SingleChannelNameRoutingTestBean(); Method routingMethod = testBean.getClass().getMethod("routePayload", String.class); @@ -65,7 +65,7 @@ public class MethodInvokingRouterTests { public void channelNameResolutionByPayloadConfiguredByMethodName() { QueueChannel barChannel = new QueueChannel(); barChannel.setBeanName("bar-channel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(barChannel); SingleChannelNameRoutingTestBean testBean = new SingleChannelNameRoutingTestBean(); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routePayload"); @@ -84,7 +84,7 @@ public class MethodInvokingRouterTests { QueueChannel barChannel = new QueueChannel(); fooChannel.setBeanName("foo-channel"); barChannel.setBeanName("bar-channel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(fooChannel); channelRegistry.registerChannel(barChannel); SingleChannelNameRoutingTestBean testBean = new SingleChannelNameRoutingTestBean(); @@ -133,7 +133,7 @@ public class MethodInvokingRouterTests { QueueChannel barChannel = new QueueChannel(); fooChannel.setBeanName("foo-channel"); barChannel.setBeanName("bar-channel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(fooChannel); channelRegistry.registerChannel(barChannel); endpoint.setChannelRegistry(channelRegistry); @@ -153,7 +153,7 @@ public class MethodInvokingRouterTests { @Test public void channelInstanceResolutionByPayloadConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelRegistry); Method routingMethod = testBean.getClass().getMethod("routePayload", String.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -163,7 +163,7 @@ public class MethodInvokingRouterTests { @Test public void channelInstanceResolutionByPayloadConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelRegistry); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routePayload"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -194,7 +194,7 @@ public class MethodInvokingRouterTests { @Test public void channelInstanceResolutionByMessageConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelRegistry); Method routingMethod = testBean.getClass().getMethod("routeMessage", Message.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -204,7 +204,7 @@ public class MethodInvokingRouterTests { @Test public void channelInstanceResolutionByMessageConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelRegistry); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routeMessage"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -235,7 +235,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameResolutionByPayloadConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); Method routingMethod = testBean.getClass().getMethod("routePayload", String.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -245,7 +245,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameResolutionByPayloadConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routePayload"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -282,7 +282,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameResolutionByMessageConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); Method routingMethod = testBean.getClass().getMethod("routeMessage", Message.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -292,7 +292,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameResolutionByMessageConfiguredByMethodName() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routeMessage"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -329,7 +329,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameArrayResolutionByMessageConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); Method routingMethod = testBean.getClass().getMethod("routeMessageToArray", Message.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -339,7 +339,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelNameArrayResolutionByMessageConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelNameRoutingTestBean testBean = new MultiChannelNameRoutingTestBean(); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routeMessageToArray"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -376,7 +376,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelListResolutionByPayloadConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); Method routingMethod = testBean.getClass().getMethod("routePayload", String.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -386,7 +386,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelListResolutionByPayloadConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routePayload"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -423,7 +423,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelListResolutionByMessageConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); Method routingMethod = testBean.getClass().getMethod("routeMessage", Message.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -433,7 +433,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelListResolutionByMessageConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routeMessage"); RouterEndpoint endpoint = new RouterEndpoint(resolver); @@ -470,7 +470,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelArrayResolutionByMessageConfiguredByMethodReference() throws Exception { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); Method routingMethod = testBean.getClass().getMethod("routeMessageToArray", Message.class); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, routingMethod); @@ -480,7 +480,7 @@ public class MethodInvokingRouterTests { @Test public void multiChannelArrayResolutionByMessageConfiguredByMethodName() { - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelRegistry); MethodInvokingChannelResolver resolver = new MethodInvokingChannelResolver(testBean, "routeMessageToArray"); RouterEndpoint endpoint = new RouterEndpoint(resolver); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java index efef14f7ff..141e5c5634 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/MultiChannelRouterTests.java @@ -25,7 +25,7 @@ import java.util.List; import org.junit.Test; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.Message; @@ -71,7 +71,7 @@ public class MultiChannelRouterTests { QueueChannel channel2 = new QueueChannel(); channel1.setBeanName("channel1"); channel2.setBeanName("channel2"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel1); channelRegistry.registerChannel(channel2); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); @@ -93,7 +93,7 @@ public class MultiChannelRouterTests { return new String[] {"noSuchChannel"}; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); Message message = new StringMessage("test"); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java index 98876df2bc..9f23a92176 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/PayloadTypeRouterTests.java @@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.junit.Test; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.GenericMessage; @@ -62,7 +62,7 @@ public class PayloadTypeRouterTests { Map, MessageChannel> channelMappings = new ConcurrentHashMap, MessageChannel>(); channelMappings.put(String.class, stringChannel); channelMappings.put(Integer.class, integerChannel); - DefaultChannelRegistry channelRegistry = new DefaultChannelRegistry(); + TestChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(stringChannel); channelRegistry.registerChannel(integerChannel); PayloadTypeChannelResolver resolver = new PayloadTypeChannelResolver(); @@ -85,7 +85,7 @@ public class PayloadTypeRouterTests { stringChannel.setBeanName("stringChannel"); QueueChannel defaultChannel = new QueueChannel(); defaultChannel.setBeanName("defaultChannel"); - DefaultChannelRegistry channelRegistry = new DefaultChannelRegistry(); + TestChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(stringChannel); channelRegistry.registerChannel(defaultChannel); Map, MessageChannel> channelMappings = new ConcurrentHashMap, MessageChannel>(); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java index c67f1d5113..2971bad236 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.integration.ConfigurationException; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.Message; @@ -84,7 +84,7 @@ public class RecipientListRouterTests { QueueChannel channel2 = new QueueChannel(); channel1.setBeanName("channel1"); channel2.setBeanName("channel2"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel1); channelRegistry.registerChannel(channel2); RecipientListChannelResolver resolver = new RecipientListChannelResolver(); @@ -108,7 +108,7 @@ public class RecipientListRouterTests { QueueChannel channel2 = new QueueChannel(); channel1.setBeanName("channel1"); channel2.setBeanName("channel2"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel1); channelRegistry.registerChannel(channel2); RecipientListChannelResolver resolver = new RecipientListChannelResolver(); @@ -134,7 +134,7 @@ public class RecipientListRouterTests { List channels = new ArrayList(); channels.add(channel1); channels.add(channel2); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel1); channelRegistry.registerChannel(channel2); RecipientListChannelResolver resolver = new RecipientListChannelResolver(); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/RouterEndpointTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/RouterEndpointTests.java index ea4f1f261c..79f5c82e88 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/RouterEndpointTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/RouterEndpointTests.java @@ -22,7 +22,7 @@ import java.util.List; import org.junit.Test; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageDeliveryException; @@ -91,7 +91,7 @@ public class RouterEndpointTests { return null; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); Message message = new StringMessage("test"); @@ -105,7 +105,7 @@ public class RouterEndpointTests { return null; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); endpoint.setResolutionRequired(true); @@ -121,7 +121,7 @@ public class RouterEndpointTests { return new String[] {}; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); Message message = new StringMessage("test"); @@ -135,7 +135,7 @@ public class RouterEndpointTests { return new String[] {}; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); endpoint.setResolutionRequired(true); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java index f4ba49071a..18aef6b780 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/router/SingleChannelRouterTests.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.springframework.integration.channel.ChannelRegistry; -import org.springframework.integration.channel.DefaultChannelRegistry; +import org.springframework.integration.channel.TestChannelRegistry; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.message.Message; @@ -59,7 +59,7 @@ public class SingleChannelRouterTests { }; QueueChannel channel = new QueueChannel(); channel.setBeanName("testChannel"); - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); channelRegistry.registerChannel(channel); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); @@ -89,7 +89,7 @@ public class SingleChannelRouterTests { return "noSuchChannel"; } }; - ChannelRegistry channelRegistry = new DefaultChannelRegistry(); + ChannelRegistry channelRegistry = new TestChannelRegistry(); RouterEndpoint endpoint = new RouterEndpoint(channelNameResolver); endpoint.setChannelRegistry(channelRegistry); Message message = new StringMessage("test");