TestSizeBeanContext.java 文件源码

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

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

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

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

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

    // It's verified that the BeanContext contains 4 components
    if (contextForSize.size() == 4) {
        return passed();
    } else {
        return failed("testSize() - failed ");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号