BeanUtils测试案例

Posted m0_56426304

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BeanUtils测试案例相关的知识,希望对你有一定的参考价值。

public class BeanUtilsTest{
  @Test
  public void test(){
     User user = new User();
     try{BeanUtils.setProperty()user,"username","zhangsan"};
    }catch(IllegalAccessException e){
        e.printStackTrace();
    }catch(InvocationTargetException e){
        e.printStackTrace();
}
    System.out.println(user);
}
}

一般情况下成员变量和属性名字一样

以上是关于BeanUtils测试案例的主要内容,如果未能解决你的问题,请参考以下文章