From 8314eeebf80247f8b74abb8c3f7f9a82729a8147 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 30 Aug 2010 18:37:07 +0000 Subject: [PATCH] INT-1389 removed all dependencies on StringMessage from unit tests in spring-integration-event --- .../ApplicationEventPublishingMessageHandlerTests.java | 6 +++--- .../config/EventOutboundChannelAdapterParserTests.java | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageHandlerTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageHandlerTests.java index ec51a40494..b080bdff69 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageHandlerTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/ApplicationEventPublishingMessageHandlerTests.java @@ -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("testing"); handler.handleMessage(message); ApplicationEvent event = publisher.getLastEvent(); assertEquals(MessagingEvent.class, event.getClass()); diff --git a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java index c35de86285..ea74d7c636 100644 --- a/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java +++ b/spring-integration-event/src/test/java/org/springframework/integration/event/config/EventOutboundChannelAdapterParserTests.java @@ -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("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("hello")); barier.await(); Assert.assertTrue(recievedEvent); }