ExpressionTest.java 文件源码

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

项目:cn1 作者:
/**
 * The test checks the correct static method is initialized
 */
public void testStatic() throws Exception {
    SampleBean theBean = new SampleBean();
    Expression expr = new Expression(SampleBean.class, "create",
            new Object[] { "hello", theBean });

    Object result = expr.getValue();
    if (result != null && result instanceof SampleBean) {
        SampleBean bean = (SampleBean) result;
        assertEquals("hello", bean.getText());
        assertEquals(theBean, bean.getObject());
    } else {
        fail("Cannot instantiate an instance of Bean class by "
                + "static method.");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号