TestSizeBeanContext.java 文件源码

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

项目:freeVM 作者:
/**
 * @see java.beans.beancontext.BeanContextSupport#isEmpty()
 */
public Result testIsContextEmpty() throws Exception {

    // The BeanContext object to be checked by the test
    BeanContextSupport context = new BeanContextSupport(); 

    // Components that should be added to context
    BeanContextSupport subContext = new BeanContextSupport();                                                                  
    BeanWithBeanContext beanWithContext = new BeanWithBeanContext();        
    BeanContextChildSupport bean = new BeanContextChildSupport();

    // Adding the components
    context.add(subContext);
    context.add(beanWithContext);
    context.add(bean);

    // It's verified that the BeanContext isn't empty
    if (!context.isEmpty()) {
        return passed();
    } else {
        return failed("testIsContextEmpty() - failed ");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号