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

This commit is contained in:
Mark Fisher
2010-08-30 18:37:07 +00:00
parent a74595819e
commit 8314eeebf8
2 changed files with 9 additions and 6 deletions

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.
@@ -24,7 +24,7 @@ import org.junit.Test;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.integration.Message;
import org.springframework.integration.core.StringMessage;
import org.springframework.integration.core.GenericMessage;
/**
* @author Mark Fisher
@@ -38,7 +38,7 @@ public class ApplicationEventPublishingMessageHandlerTests {
ApplicationEventPublishingMessageHandler handler = new ApplicationEventPublishingMessageHandler();
handler.setApplicationEventPublisher(publisher);
assertNull(publisher.getLastEvent());
Message<?> message = new StringMessage("testing");
Message<?> message = new GenericMessage<String>("testing");
handler.handleMessage(message);
ApplicationEvent event = publisher.getLastEvent();
assertEquals(MessagingEvent.class, event.getClass());

View File

@@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.event.config;
import java.util.concurrent.CyclicBarrier;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
@@ -29,8 +32,8 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.GenericMessage;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.core.StringMessage;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.event.ApplicationEventPublishingMessageHandler;
import org.springframework.test.context.ContextConfiguration;
@@ -73,7 +76,7 @@ public class EventOutboundChannelAdapterParserTests {
};
context.addApplicationListener(listener);
DirectChannel channel = context.getBean("input", DirectChannel.class);
channel.send(new StringMessage("hello"));
channel.send(new GenericMessage<String>("hello"));
Assert.assertTrue(recievedEvent);
}
@@ -99,7 +102,7 @@ public class EventOutboundChannelAdapterParserTests {
};
ac.addApplicationListener(listener);
QueueChannel channel = ac.getBean("input", QueueChannel.class);
channel.send(new StringMessage("hello"));
channel.send(new GenericMessage<String>("hello"));
barier.await();
Assert.assertTrue(recievedEvent);
}