@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
}
}
BeanWrapperTests.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:class-guard
作者:
评论列表
文章目录