@Test public void testConstructContainerWithBasePackage() throws Exception { AnnotationConfigApplicationContext configApplicationContext = beanFactory.constructContainerWithBasePackage( "org.springframework.samples.model.annotation"); configApplicationContext.refresh(); ComponentAnnotationModel model = configApplicationContext.getBean(ComponentAnnotationModel.class); System.out.println(PrintUtil.formatTestResult(model)); configApplicationContext.destroy(); }
public AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage) { AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(); configApplicationContext.scan(basePackage); return configApplicationContext; }
AnnotationConfigApplicationContextBeanFactory { public AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage) { AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(); configApplicationContext.scan(basePackage); return configApplicationContext; } }
AnnotationConfigApplicationContextBeanFactory { public AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage) { AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(); configApplicationContext.scan(basePackage); return configApplicationContext; }  }
AnnotationConfigApplicationContextBeanFactory { public AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage) { AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(); configApplicationContext.scan(basePackage); return configApplicationContext; }  AnnotationConfigApplicationContext simpleConstructContainer(); AnnotationConfigApplicationContext constructContainerWithConfigBean(Class<?>... classes); AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage); }
AnnotationConfigApplicationContextBeanFactory { public AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage) { AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(); configApplicationContext.scan(basePackage); return configApplicationContext; }  AnnotationConfigApplicationContext simpleConstructContainer(); AnnotationConfigApplicationContext constructContainerWithConfigBean(Class<?>... classes); AnnotationConfigApplicationContext constructContainerWithBasePackage(String basePackage);  }