BeanWrapperTests.java 文件源码

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

项目:class-guard 作者:
@Test
public void testEnumByFieldName() {
    EnumTester et = new EnumTester();
    BeanWrapper bw = new BeanWrapperImpl(et);

    bw.setPropertyValue("autowire", "BY_NAME");
    assertEquals(Autowire.BY_NAME, et.getAutowire());

    bw.setPropertyValue("autowire", "  BY_TYPE ");
    assertEquals(Autowire.BY_TYPE, et.getAutowire());

    try {
        bw.setPropertyValue("autowire", "NHERITED");
        fail("Should have thrown TypeMismatchException");
    }
    catch (TypeMismatchException ex) {
        // expected
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号