@Test
public void testViewScopedClass() {
GenericApplicationContext acx = new GenericApplicationContext();
AnnotationConfigUtils.registerAnnotationConfigProcessors(acx);
acx.registerBeanDefinition("viewScopedClass", new AnnotatedGenericBeanDefinition(
new StandardAnnotationMetadata(ViewScopedClass.class)));
acx.registerBeanDefinition("scopedBeansConfiguration", new RootBeanDefinition(
ScopedBeansConfiguration.class));
acx.addBeanFactoryPostProcessor(JsfScopeAnnotationsAutoConfiguration.jsfScopeAnnotationsConfigurer(acx.getEnvironment()));
acx.addBeanFactoryPostProcessor(CdiScopeAnnotationsAutoConfiguration.cdiScopeAnnotationsConfigurer(acx.getEnvironment()));
acx.refresh();
assertThat(acx.getBeanDefinition("viewScopedClass").getScope())
.isEqualTo(ViewScope.SCOPE_VIEW);
assertThat(acx.getBeanDefinition("viewScopedBean").getScope())
.isEqualTo(ViewScope.SCOPE_VIEW);
}
JsfCdiToSpringApplicationBeanFactoryPostProcessorIT.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:joinfaces
作者:
评论列表
文章目录