ViewResolverTests.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:spring4-understanding 作者:
@Test
public void testXmlViewResolverDefaultLocation() {
    StaticWebApplicationContext wac = new StaticWebApplicationContext() {
        @Override
        protected Resource getResourceByPath(String path) {
            assertTrue("Correct default location", XmlViewResolver.DEFAULT_LOCATION.equals(path));
            return super.getResourceByPath(path);
        }
    };
    wac.setServletContext(new MockServletContext());
    wac.refresh();
    XmlViewResolver vr = new XmlViewResolver();
    try {
        vr.setApplicationContext(wac);
        vr.afterPropertiesSet();
        fail("Should have thrown BeanDefinitionStoreException");
    }
    catch (BeanDefinitionStoreException ex) {
        // expected
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号