1 16 17 package org.springframework.context.access; 18 19 import org.springframework.beans.factory.access.BeanFactoryLocator; 20 import org.springframework.beans.factory.access.SingletonBeanFactoryLocatorTests; 21 import org.springframework.context.support.ClassPathXmlApplicationContext; 22 import org.springframework.util.ClassUtils; 23 24 27 public class ContextSingletonBeanFactoryLocatorTests extends SingletonBeanFactoryLocatorTests { 28 29 public void testBaseBeanFactoryDefs() { 30 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( 33 new String [] {"/org/springframework/beans/factory/access/beans1.xml", 34 "/org/springframework/beans/factory/access/beans2.xml"}); 35 } 36 37 public void testBasicFunctionality() { 38 39 ContextSingletonBeanFactoryLocator facLoc = new ContextSingletonBeanFactoryLocator( 42 "classpath*:" + ClassUtils.addResourcePathToPackagePath( 43 SingletonBeanFactoryLocatorTests.class, "ref1.xml")); 44 45 basicFunctionalityTest(facLoc); 46 } 47 48 public void testGetInstance() { 52 53 BeanFactoryLocator facLoc = ContextSingletonBeanFactoryLocator.getInstance( 55 ClassUtils.addResourcePathToPackagePath( 56 SingletonBeanFactoryLocatorTests.class, "ref1.xml")); 57 getInstanceTest1(facLoc); 58 59 facLoc = ContextSingletonBeanFactoryLocator.getInstance( 60 "classpath*:" + ClassUtils.addResourcePathToPackagePath( 61 SingletonBeanFactoryLocatorTests.class, "ref1.xml")); 62 getInstanceTest2(facLoc); 63 64 facLoc = ContextSingletonBeanFactoryLocator.getInstance( 66 "classpath:" + ClassUtils.addResourcePathToPackagePath( 67 SingletonBeanFactoryLocatorTests.class, "ref1.xml")); 68 getInstanceTest3(facLoc); 69 } 70 } 71 | Popular Tags |