@Test
public void testSetProperty() throws Exception {

    TestBean config = new TestBean();
    BeanUtils.setProperty(config, "alias", String.class, "1111aaaa");
    Assert.assertEquals(config.getAlias(), "1111aaaa");
    BeanUtils.setProperty(config, "alias", String.class, null);
    Assert.assertNull(config.getAlias());
    BeanUtils.setProperty(config, "heartbeat", int.class, 3000);
    Assert.assertEquals(config.getHeartbeat(), 3000);
    BeanUtils.setProperty(config, "heartbeat", int.class, new Integer(7000));
    Assert.assertEquals(config.getHeartbeat(), 7000);
    boolean error = false;
    try {
        BeanUtils.setProperty(config, "xxx", String.class, "1111aaaa");
    } catch (Exception e) {
        error = true;
    }
    Assert.assertTrue(error);
}