예제 #1
0
 @Test
 public void testGetProperty_field() throws Exception {
   C1 object = new C1();
   String propertyName = "string2";
   String value = "myStringValue";
   object.string2 = value;
   Bean instance = new Bean(C1.class);
   Object result = instance.getProperty(object, propertyName);
   assertEquals(value, result);
 }
예제 #2
0
 @Test
 public void testGetProperty_string1() throws Exception {
   System.out.println("getProperty");
   C1 object = new C1();
   String propertyName = "string1";
   Bean instance = new Bean(C1.class);
   String expResult = "myExpResult";
   object.setString1(expResult);
   Object result = instance.getProperty(object, propertyName);
   assertEquals(expResult, result);
 }
예제 #3
0
 @Test
 public void testGetProperty_3args_correct() throws Exception {
   C1 object = new C1();
   String propertyName = "string1";
   ClassFilter filter = new SimpleClassFilter();
   Bean instance = new Bean(C1.class);
   String expResult = "mystring";
   object.setString1(expResult);
   Object result = instance.getProperty(object, propertyName, filter);
   assertEquals(expResult, result);
 }