INT-1389 removed all dependencies on StringMessage from unit tests in spring-integration-rmi

This commit is contained in:
Mark Fisher
2010-08-30 18:56:12 +00:00
parent 959241a8e6
commit 1d2bfd0c63
2 changed files with 8 additions and 10 deletions

View File

@@ -30,9 +30,7 @@ import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.GenericMessage;
import org.springframework.integration.core.MessageBuilder;
import org.springframework.integration.core.StringMessage;
import org.springframework.integration.gateway.RequestReplyExchanger;
import org.springframework.integration.rmi.RmiOutboundGateway;
import org.springframework.remoting.RemoteLookupFailureException;
import org.springframework.remoting.rmi.RmiServiceExporter;
@@ -63,7 +61,7 @@ public class RmiOutboundGatewayTests {
@Test
public void serializablePayload() throws RemoteException {
gateway.handleMessage(new StringMessage("test"));
gateway.handleMessage(new GenericMessage<String>("test"));
Message<?> replyMessage = output.receive(0);
assertNotNull(replyMessage);
assertEquals("TEST", replyMessage.getPayload());
@@ -101,7 +99,7 @@ public class RmiOutboundGatewayTests {
RmiOutboundGateway gateway = new RmiOutboundGateway("rmi://localhost:1099/noSuchService");
boolean exceptionThrown = false;
try {
gateway.handleMessage(new StringMessage("test"));
gateway.handleMessage(new GenericMessage<String>("test"));
}
catch (MessageHandlingException e) {
assertEquals(RemoteLookupFailureException.class, e.getCause().getClass());
@@ -115,7 +113,7 @@ public class RmiOutboundGatewayTests {
RmiOutboundGateway gateway = new RmiOutboundGateway("rmi://noSuchHost:1099/testRemoteHandler");
boolean exceptionThrown = false;
try {
gateway.handleMessage(new StringMessage("test"));
gateway.handleMessage(new GenericMessage<String>("test"));
}
catch (MessageHandlingException e) {
assertEquals(RemoteLookupFailureException.class, e.getCause().getClass());
@@ -129,7 +127,7 @@ public class RmiOutboundGatewayTests {
RmiOutboundGateway gateway = new RmiOutboundGateway("invalid");
boolean exceptionThrown = false;
try {
gateway.handleMessage(new StringMessage("test"));
gateway.handleMessage(new GenericMessage<String>("test"));
}
catch (MessageHandlingException e) {
assertEquals(RemoteLookupFailureException.class, e.getCause().getClass());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 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.
@@ -26,8 +26,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.GenericMessage;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.core.StringMessage;
import org.springframework.integration.rmi.RmiInboundGateway;
/**
@@ -53,7 +53,7 @@ public class RmiOutboundGatewayParserTests {
ApplicationContext context = new ClassPathXmlApplicationContext(
"rmiOutboundGatewayParserTests.xml", this.getClass());
MessageChannel localChannel = (MessageChannel) context.getBean("localChannel");
localChannel.send(new StringMessage("test"));
localChannel.send(new GenericMessage<String>("test"));
Message<?> result = testChannel.receive(1000);
assertNotNull(result);
assertEquals("test", result.getPayload());
@@ -64,7 +64,7 @@ public class RmiOutboundGatewayParserTests {
ApplicationContext context = new ClassPathXmlApplicationContext(
"rmiOutboundGatewayParserTests.xml", this.getClass());
MessageChannel localChannel = (MessageChannel) context.getBean("localChannel");
localChannel.send(new StringMessage("test"));
localChannel.send(new GenericMessage<String>("test"));
Message<?> result = testChannel.receive(1000);
assertNotNull(result);
assertEquals("test", result.getPayload());