diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java similarity index 96% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java index 4e46cc786a..1f0df6abda 100644 --- a/org.springframework.testsuite/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java +++ b/org.springframework.context.support/src/test/java/org/springframework/context/support/ApplicationContextLifecycleTests.java @@ -16,13 +16,17 @@ package org.springframework.context.support; -import junit.framework.TestCase; +import static org.junit.Assert.*; + +import org.junit.Test; /** * @author Mark Fisher + * @author Chris Beams */ -public class ApplicationContextLifecycleTests extends TestCase { +public class ApplicationContextLifecycleTests { + @Test public void testBeansStart() { AbstractApplicationContext context = new ClassPathXmlApplicationContext("lifecycleTests.xml", getClass()); context.start(); @@ -37,6 +41,7 @@ public class ApplicationContextLifecycleTests extends TestCase { assertTrue(error, bean4.isRunning()); } + @Test public void testBeansStop() { AbstractApplicationContext context = new ClassPathXmlApplicationContext("lifecycleTests.xml", getClass()); context.start(); @@ -57,6 +62,7 @@ public class ApplicationContextLifecycleTests extends TestCase { assertFalse(stopError, bean4.isRunning()); } + @Test public void testStartOrder() { AbstractApplicationContext context = new ClassPathXmlApplicationContext("lifecycleTests.xml", getClass()); context.start(); @@ -75,6 +81,7 @@ public class ApplicationContextLifecycleTests extends TestCase { assertTrue(orderError, bean4.getStartOrder() > bean2.getStartOrder()); } + @Test public void testStopOrder() { AbstractApplicationContext context = new ClassPathXmlApplicationContext("lifecycleTests.xml", getClass()); context.start(); diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/LifecycleTestBean.java b/org.springframework.context.support/src/test/java/org/springframework/context/support/LifecycleTestBean.java similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/LifecycleTestBean.java rename to org.springframework.context.support/src/test/java/org/springframework/context/support/LifecycleTestBean.java diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/support/lifecycleTests.xml b/org.springframework.context.support/src/test/java/org/springframework/context/support/lifecycleTests.xml similarity index 100% rename from org.springframework.testsuite/src/test/java/org/springframework/context/support/lifecycleTests.xml rename to org.springframework.context.support/src/test/java/org/springframework/context/support/lifecycleTests.xml diff --git a/org.springframework.testsuite/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java b/org.springframework.testsuite/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java index 32068bd009..55524b692b 100644 --- a/org.springframework.testsuite/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java +++ b/org.springframework.testsuite/src/test/java/org/springframework/context/access/ContextSingletonBeanFactoryLocatorTests.java @@ -20,8 +20,9 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.access.BeanFactoryLocator; import org.springframework.beans.factory.access.BeanFactoryReference; import org.springframework.beans.factory.access.SingletonBeanFactoryLocatorTests; +import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.core.io.ClassPathResource; import org.springframework.util.ClassUtils; /** @@ -33,9 +34,8 @@ public class ContextSingletonBeanFactoryLocatorTests extends SingletonBeanFactor public void testBaseBeanFactoryDefs() { // Just test the base BeanFactory/AppContext defs we are going to work // with in other tests. - ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( - new String[] {"/org/springframework/beans/factory/access/beans1.xml", - "/org/springframework/beans/factory/access/beans2.xml"}); + new XmlBeanFactory(new ClassPathResource("/org/springframework/beans/factory/access/beans1.xml")); + new XmlBeanFactory(new ClassPathResource("/org/springframework/beans/factory/access/beans2.xml")); } public void testBasicFunctionality() {