提交 0a47beb6 编写于 作者: C Chris Beams

moving unit tests from .testsuite -> .context.support

上级 7432202b
......@@ -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();
......
......@@ -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() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册