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

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

Introduction

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

Prototype

public void setAge(int age) 

Source Link

Usage

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

public void testGetProperty() throws Exception {
    List classes = new ArrayList();
    classes.add(FullName.class);
    PropertyUtilsBean propertyUtils = new SuppressPropertyUtilsBean(classes);
    Person person = new Person();
    person.getFullName().setFirstName("aaa");
    person.getFullName().setLastName("bbb");
    person.getAddress().setStreet("ccc");
    person.setAge("20");
    try {/*from  www  .j  a v  a 2 s  .c om*/
        propertyUtils.getProperty(person, "fullName.firstName");
    } catch (NoSuchMethodException expected) {
    }
    try {
        propertyUtils.getProperty(person, "fullName.lastName");
    } catch (NoSuchMethodException expected) {
    }
    assertEquals("ccc", propertyUtils.getProperty(person, "address.street"));
    assertEquals("20", propertyUtils.getProperty(person, "age"));
}