Example usage for org.apache.commons.beanutils Person getAge

List of usage examples for org.apache.commons.beanutils Person getAge

Introduction

In this page you can find the example usage for org.apache.commons.beanutils Person getAge.

Prototype

public int getAge() 

Source Link

Usage

From source file:org.seasar.struts.bean.SuppressPropertyUtilsBeanTest.java

public void testBeanUtilsBean_default_populate() throws Exception {
    BeanUtilsBean beanUtils = new BeanUtilsBean();
    Person person = new Person();
    Map properties = new HashMap();
    properties.put("fullName.firstName", "aaa");
    properties.put("fullName.lastName", "bbb");
    properties.put("address.street", "ccc");
    properties.put("age", "20");
    beanUtils.populate(person, properties);
    assertEquals("aaa", person.getFullName().getFirstName());
    assertEquals("bbb", person.getFullName().getLastName());
    assertEquals("ccc", person.getAddress().getStreet());
    assertEquals("20", person.getAge());
}

From source file:org.seasar.struts.bean.SuppressPropertyUtilsBeanTest.java

public void testBeanUtilsBean_suppressed_populate() throws Exception {
    List classes = new ArrayList();
    classes.add(FullName.class);
    BeanUtilsBean beanUtils = new BeanUtilsBean(new ConvertUtilsBean(), new SuppressPropertyUtilsBean(classes));
    Person person = new Person();
    Map properties = new HashMap();
    properties.put("fullName.firstName", "aaa");
    properties.put("fullName.lastName", "bbb");
    properties.put("address.street", "ccc");
    properties.put("age", "20");
    beanUtils.populate(person, properties);
    assertNull(person.getFullName().getFirstName());
    assertNull(person.getFullName().getLastName());
    assertEquals("ccc", person.getAddress().getStreet());
    assertEquals("20", person.getAge());
}