org.springframework.jdbc.core.test.SpacePerson Java Examples

The following examples show how to use org.springframework.jdbc.core.test.SpacePerson. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeanPropertyRowMapperTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testQueryWithSpaceInColumnNameAndLocalDateTime() throws Exception {
	Mock mock = new Mock(MockType.THREE);
	List<SpacePerson> result = mock.getJdbcTemplate().query(
			"select last_name as \"Last Name\", age, birth_date, balance from people",
			new BeanPropertyRowMapper<>(SpacePerson.class));
	assertEquals(1, result.size());
	verifyPerson(result.get(0));
	mock.verifyClosed();
}
 
Example #2
Source File: BeanPropertyRowMapperTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testQueryWithSpaceInColumnNameAndLocalDateTime() throws Exception {
	Mock mock = new Mock(MockType.THREE);
	List<SpacePerson> result = mock.getJdbcTemplate().query(
			"select last_name as \"Last Name\", age, birth_date, balance from people",
			new BeanPropertyRowMapper<>(SpacePerson.class));
	assertEquals(1, result.size());
	verifyPerson(result.get(0));
	mock.verifyClosed();
}
 
Example #3
Source File: BeanPropertyRowMapperTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testQueryWithSpaceInColumnName() throws Exception {
	Mock mock = new Mock(MockType.THREE);
	List<SpacePerson> result = mock.getJdbcTemplate().query(
			"select last_name as \"Last Name\", age, birth_date, balance from people",
			new BeanPropertyRowMapper<SpacePerson>(SpacePerson.class));
	assertEquals(1, result.size());
	verifySpacePerson(result.get(0));
	mock.verifyClosed();
}
 
Example #4
Source File: BeanPropertyRowMapperTests.java    From effectivejava with Apache License 2.0 5 votes vote down vote up
@Test
public void testQueryWithSpaceInColumnName() throws Exception {
	Mock mock = new Mock(MockType.THREE);
	List<SpacePerson> result = mock.getJdbcTemplate().query(
			"select last_name as \"Last Name\", age, birth_date, balance from people",
			new BeanPropertyRowMapper<SpacePerson>(SpacePerson.class));
	assertEquals(1, result.size());
	verifySpacePerson(result.get(0));
	mock.verifyClosed();
}
 
Example #5
Source File: AbstractRowMapperTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
protected void verifyPerson(SpacePerson bean) {
	assertEquals("Bubba", bean.getLastName());
	assertEquals(22L, bean.getAge());
	assertEquals(new java.sql.Timestamp(1221222L).toLocalDateTime(), bean.getBirthDate());
	assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}
 
Example #6
Source File: AbstractRowMapperTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
protected void verifyPerson(SpacePerson bean) {
	assertEquals("Bubba", bean.getLastName());
	assertEquals(22L, bean.getAge());
	assertEquals(new java.sql.Timestamp(1221222L).toLocalDateTime(), bean.getBirthDate());
	assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}
 
Example #7
Source File: AbstractRowMapperTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected void verifySpacePerson(SpacePerson bean) {
	assertEquals("Bubba", bean.getLastName());
	assertEquals(22L, bean.getAge());
	assertEquals(new java.util.Date(1221222L), bean.getBirthDate());
	assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}
 
Example #8
Source File: AbstractRowMapperTests.java    From effectivejava with Apache License 2.0 4 votes vote down vote up
protected void verifySpacePerson(SpacePerson bean) {
	assertEquals("Bubba", bean.getLastName());
	assertEquals(22L, bean.getAge());
	assertEquals(new java.util.Date(1221222L), bean.getBirthDate());
	assertEquals(new BigDecimal("1234.56"), bean.getBalance());
}