From 9550fcf87b6e12957fe93c37400a00901e41b22c Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 15 Nov 2010 16:36:03 -0500 Subject: [PATCH] INT-1617 renaming test classes and confif files --- ...oundChannelAdapterParserTests-context.xml} | 0 ...nceOutboundChannelAdapterParserTests.java} | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) rename spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/{XmppRosterEventOutboundChannelAdapterParserTests-context.xml => PresenceOutboundChannelAdapterParserTests-context.xml} (100%) rename spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/{XmppRosterEventOutboundChannelAdapterParserTests.java => PresenceOutboundChannelAdapterParserTests.java} (64%) diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppRosterEventOutboundChannelAdapterParserTests-context.xml b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParserTests-context.xml similarity index 100% rename from spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppRosterEventOutboundChannelAdapterParserTests-context.xml rename to spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParserTests-context.xml diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppRosterEventOutboundChannelAdapterParserTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParserTests.java similarity index 64% rename from spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppRosterEventOutboundChannelAdapterParserTests.java rename to spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParserTests.java index 5885c21ede..11c5e0aab7 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/XmppRosterEventOutboundChannelAdapterParserTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/PresenceOutboundChannelAdapterParserTests.java @@ -19,39 +19,42 @@ package org.springframework.integration.xmpp.config; import static junit.framework.Assert.assertTrue; import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.core.SubscribableChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.endpoint.PollingConsumer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Oleg Zhurakousky - * + * @author Mark Fisher */ -public class XmppRosterEventOutboundChannelAdapterParserTests { +@ContextConfiguration +@RunWith(SpringJUnit4ClassRunner.class) +public class PresenceOutboundChannelAdapterParserTests { + + @Autowired + private ApplicationContext context; @Test public void testRosterEventOutboundChannelAdapterParserAsPollingConsumer(){ - ApplicationContext ac = - new ClassPathXmlApplicationContext("XmppRosterEventOutboundChannelAdapterParserTests-context.xml", this.getClass()); - Object pollingConsumer = ac.getBean("pollingOutboundRosterAdapter"); + Object pollingConsumer = context.getBean("pollingOutboundRosterAdapter"); assertTrue(pollingConsumer instanceof PollingConsumer); } @Test public void testRosterEventOutboundChannelAdapterParserEventConsumer(){ - ApplicationContext ac = - new ClassPathXmlApplicationContext("XmppRosterEventOutboundChannelAdapterParserTests-context.xml", this.getClass()); - Object eventConsumer = ac.getBean("eventOutboundRosterAdapter"); + Object eventConsumer = context.getBean("eventOutboundRosterAdapter"); assertTrue(eventConsumer instanceof EventDrivenConsumer); } @Test public void testRosterEventOutboundChannel(){ - ApplicationContext ac = - new ClassPathXmlApplicationContext("XmppRosterEventOutboundChannelAdapterParserTests-context.xml", this.getClass()); - Object channel = ac.getBean("eventOutboundRosterChannel"); + Object channel = context.getBean("eventOutboundRosterChannel"); assertTrue(channel instanceof SubscribableChannel); }