예제 #1
0
 public void testShouldSuccessfullyGetAndSetValueOnBeanWithOverloadedSetter() throws Exception {
   BeanWithOverloadedSetter bean = new BeanWithOverloadedSetter();
   ClassInfo info = ClassInfo.getInstance(BeanWithOverloadedSetter.class);
   info.getSetter(PROPNAME).invoke(bean, STRING_PARAMS);
   assertEquals(STRING_VALUE, info.getGetter(PROPNAME).invoke(bean, NO_VALUE));
   assertEquals(String.class, info.getSetterType(PROPNAME));
   assertEquals(String.class, info.getGetterType(PROPNAME));
 }
예제 #2
0
 public void testShouldSuccessfullyGetAndSetValueOnBeanWithDifferentTypeGetterSetter()
     throws Exception {
   BeanWithDifferentTypeGetterSetter bean = new BeanWithDifferentTypeGetterSetter();
   ClassInfo info = ClassInfo.getInstance(BeanWithDifferentTypeGetterSetter.class);
   info.getSetter(PROPNAME).invoke(bean, INT_PARAMS);
   assertEquals(INT_VALUE.toString(), info.getGetter(PROPNAME).invoke(bean, NO_VALUE));
   assertEquals(Integer.class, info.getSetterType(PROPNAME));
   assertEquals(String.class, info.getGetterType(PROPNAME));
 }