Renamed PointToPointChannel to SimpleChannel.

This commit is contained in:
Mark Fisher
2008-01-09 14:00:56 +00:00
parent 318a34593d
commit 1e872b82eb
26 changed files with 97 additions and 97 deletions

View File

@@ -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<String> message = new GenericMessage<String>("123", "testing");
channel.send(message);

View File

@@ -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<String> adapter = new PollingSourceAdapter<String>(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<String> adapter = new PollingSourceAdapter<String>(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<String> adapter = new PollingSourceAdapter<String>(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<String> adapter = new PollingSourceAdapter<String>(source);
adapter.setChannel(channel);
adapter.setPeriod(1000);

View File

@@ -6,9 +6,9 @@
<bean id="bus" class="org.springframework.integration.bus.MessageBus"/>
<bean id="inputChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="inputChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="outputChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="outputChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="sourceAdapter" class="org.springframework.integration.adapter.PollingSourceAdapter">
<constructor-arg>

View File

@@ -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<Class<? extends ApplicationEvent>> eventTypes = new ArrayList<Class<? extends ApplicationEvent>>();
eventTypes.add(TestApplicationEvent1.class);

View File

@@ -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);

View File

@@ -6,7 +6,7 @@
<bean id="bus" class="org.springframework.integration.bus.MessageBus"/>
<bean id="channel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="channel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="adapter" class="org.springframework.integration.adapter.event.ApplicationEventSourceAdapter">
<property name="channel" ref="channel"/>

View File

@@ -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);

View File

@@ -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);

View File

@@ -6,7 +6,7 @@
<bean id="messageBus" class="org.springframework.integration.bus.MessageBus"/>
<bean id="testChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="testChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="testBean" class="org.springframework.integration.aop.PublisherAnnotationTestBean"/>

View File

@@ -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();

View File

@@ -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<String> endpoint = new GenericMessageEndpoint<String>() {
public void messageReceived(Message<String> 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<String> endpoint = new GenericMessageEndpoint<String>() {
public void messageReceived(Message<String> message) {
counter.incrementAndGet();

View File

@@ -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<String> endpoint1 = new GenericMessageEndpoint<String>();
endpoint1.setDefaultOutputChannelName("output1");
endpoint1.setInputChannelName("input");

View File

@@ -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);

View File

@@ -6,9 +6,9 @@
<bean id="bus" class="org.springframework.integration.bus.MessageBus"/>
<bean id="sourceChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="sourceChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="targetChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="targetChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean id="endpoint" class="org.springframework.integration.endpoint.GenericMessageEndpoint">
<property name="inputChannelName" value="sourceChannel"/>

View File

@@ -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<String>(1, "test-1"));
assertTrue(result1);
boolean result2 = channel.send(new GenericMessage<String>(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<String>(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<String>(1, "test-1"));
assertTrue(result1);
final AtomicBoolean sendInterrupted = new AtomicBoolean(false);

View File

@@ -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<String> 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());

View File

@@ -10,7 +10,7 @@
<bean id="endpoint" class="org.springframework.integration.endpoint.annotation.SimpleAnnotatedEndpoint"/>
<bean id="outputChannel" class="org.springframework.integration.channel.PointToPointChannel"/>
<bean id="outputChannel" class="org.springframework.integration.channel.SimpleChannel"/>
<bean class="org.springframework.integration.config.MessageEndpointAnnotationPostProcessor">
<property name="messageBus" ref="bus"/>

View File

@@ -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<MessageChannel> resolve(Message<?> message) {
List<MessageChannel> channels = new ArrayList<MessageChannel>();
@@ -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);

View File

@@ -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<Class<?>, MessageChannel> channelMappings = new ConcurrentHashMap<Class<?>, 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<Class<?>, MessageChannel> channelMappings = new ConcurrentHashMap<Class<?>, MessageChannel>();
channelMappings.put(String.class, stringChannel);
PayloadTypeRouter router = new PayloadTypeRouter();

View File

@@ -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<MessageChannel> channels = new ArrayList<MessageChannel>();
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<MessageChannel> channels = new ArrayList<MessageChannel>();
channels.add(channel1);
channels.add(channel2);

View File

@@ -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<String, Object> attribs = new ConcurrentHashMap<String, Object>();
RouterMessageHandlerAdapter adapter = new RouterMessageHandlerAdapter(testBean, fooMethod, attribs);
Message<String> message = new GenericMessage<String>("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<String> message = new GenericMessage<String>("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<String> message = new GenericMessage<String>("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);

View File

@@ -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() {