TestExecutionListener.java 文件源码

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

项目:businesshorizon2 作者:
@Override
public void prepareTestInstance(TestContext testContext) throws Exception {

    if (testContext.getApplicationContext() instanceof GenericApplicationContext) {
        GenericApplicationContext context = (GenericApplicationContext) testContext.getApplicationContext();
        ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
        Scope requestScope = new SimpleThreadScope();
        beanFactory.registerScope("request", requestScope);
        Scope sessionScope = new SimpleThreadScope();
        beanFactory.registerScope("session", sessionScope);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号