Java 类org.springframework.jdbc.core.test.ConcretePerson 实例源码

项目:spring4-understanding    文件:BeanPropertyRowMapperTests.java   
@Test
public void testMappingWithInheritance() throws Exception {
    Mock mock = new Mock();
    List<ConcretePerson> result = mock.getJdbcTemplate().query(
            "select name, age, birth_date, balance from people",
            new BeanPropertyRowMapper<ConcretePerson>(ConcretePerson.class));
    assertEquals(1, result.size());
    verifyConcretePerson(result.get(0));
    mock.verifyClosed();
}
项目:spring4-understanding    文件:BeanPropertyRowMapperTests.java   
@Test
public void testMappingWithNoUnpopulatedFieldsFound() throws Exception {
    Mock mock = new Mock();
    List<ConcretePerson> result = mock.getJdbcTemplate().query(
            "select name, age, birth_date, balance from people",
            new BeanPropertyRowMapper<ConcretePerson>(ConcretePerson.class, true));
    assertEquals(1, result.size());
    verifyConcretePerson(result.get(0));
    mock.verifyClosed();
}
项目:class-guard    文件:BeanPropertyRowMapperTests.java   
@Test
public void testMappingWithInheritance() throws Exception {
    Mock mock = new Mock();
    List<ConcretePerson> result = mock.getJdbcTemplate().query(
            "select name, age, birth_date, balance from people",
            new BeanPropertyRowMapper<ConcretePerson>(ConcretePerson.class));
    assertEquals(1, result.size());
    verifyConcretePerson(result.get(0));
    mock.verifyClosed();
}
项目:class-guard    文件:BeanPropertyRowMapperTests.java   
@Test
public void testMappingWithNoUnpopulatedFieldsFound() throws Exception {
    Mock mock = new Mock();
    List<ConcretePerson> result = mock.getJdbcTemplate().query(
            "select name, age, birth_date, balance from people",
            new BeanPropertyRowMapper<ConcretePerson>(ConcretePerson.class, true));
    assertEquals(1, result.size());
    verifyConcretePerson(result.get(0));
    mock.verifyClosed();
}
项目:class-guard    文件:ParameterizedBeanPropertyRowMapperTests.java   
@Test
public void testMappingWithInheritance() throws Exception {
    Mock mock = new Mock();
    List<ConcretePerson> result = mock.getJdbcTemplate().query(
            "select name, age, birth_date, balance from people",
            ParameterizedBeanPropertyRowMapper.newInstance(ConcretePerson.class));
    assertEquals(1, result.size());
    verifyConcretePerson(result.get(0));
    mock.verifyClosed();
}
项目:spring4-understanding    文件:AbstractRowMapperTests.java   
protected void verifyConcretePerson(ConcretePerson bean) throws Exception {
    assertEquals("Bubba", bean.getName());
    assertEquals(22L, bean.getAge());
    assertEquals(new java.util.Date(1221222L), bean.getBirth_date());
    assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}
项目:class-guard    文件:AbstractRowMapperTests.java   
protected void verifyConcretePerson(ConcretePerson bean) throws Exception {
    assertEquals("Bubba", bean.getName());
    assertEquals(22L, bean.getAge());
    assertEquals(new java.util.Date(1221222L), bean.getBirth_date());
    assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}