org.springframework.test.context.junit4.orm.domain.DriversLicense Java Examples

The following examples show how to use org.springframework.test.context.junit4.orm.domain.DriversLicense. 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: HibernateSessionFlushingTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void findSam() {
	Person sam = personService.findByName(SAM);
	assertNotNull("Should be able to find Sam", sam);
	DriversLicense driversLicense = sam.getDriversLicense();
	assertNotNull("Sam's driver's license should not be null", driversLicense);
	assertEquals("Verifying Sam's driver's license number", Long.valueOf(1234), driversLicense.getNumber());
}
 
Example #2
Source File: HibernateSessionFlushingTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void saveJuergenWithDriversLicense() {
	DriversLicense driversLicense = new DriversLicense(2L, 2222L);
	Person juergen = new Person(JUERGEN, driversLicense);
	int numRows = countRowsInTable("person");
	personService.save(juergen);
	assertEquals("Verifying number of rows in the 'person' table.", numRows + 1, countRowsInTable("person"));
	assertNotNull("Should be able to save and retrieve Juergen", personService.findByName(JUERGEN));
	assertNotNull("Juergen's ID should have been set", juergen.getId());
}
 
Example #3
Source File: HibernateSessionFlushingTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void findSam() {
	Person sam = personService.findByName(SAM);
	assertNotNull("Should be able to find Sam", sam);
	DriversLicense driversLicense = sam.getDriversLicense();
	assertNotNull("Sam's driver's license should not be null", driversLicense);
	assertEquals("Verifying Sam's driver's license number", Long.valueOf(1234), driversLicense.getNumber());
}
 
Example #4
Source File: HibernateSessionFlushingTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void saveJuergenWithDriversLicense() {
	DriversLicense driversLicense = new DriversLicense(2L, 2222L);
	Person juergen = new Person(JUERGEN, driversLicense);
	int numRows = countRowsInTable("person");
	personService.save(juergen);
	assertEquals("Verifying number of rows in the 'person' table.", numRows + 1, countRowsInTable("person"));
	assertNotNull("Should be able to save and retrieve Juergen", personService.findByName(JUERGEN));
	assertNotNull("Juergen's ID should have been set", juergen.getId());
}
 
Example #5
Source File: HibernateSessionFlushingTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void findSam() {
	Person sam = personService.findByName(SAM);
	assertNotNull("Should be able to find Sam", sam);
	DriversLicense driversLicense = sam.getDriversLicense();
	assertNotNull("Sam's driver's license should not be null", driversLicense);
	assertEquals("Verifying Sam's driver's license number", new Long(1234), driversLicense.getNumber());
}
 
Example #6
Source File: HibernateSessionFlushingTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void saveJuergenWithDriversLicense() {
	DriversLicense driversLicense = new DriversLicense(2L, 2222L);
	Person juergen = new Person(JUERGEN, driversLicense);
	int numRows = countRowsInPersonTable();
	personService.save(juergen);
	assertPersonCount(numRows + 1);
	assertNotNull("Should be able to save and retrieve Juergen", personService.findByName(JUERGEN));
	assertNotNull("Juergen's ID should have been set", juergen.getId());
}