Code example for AbstractTransactionalTestNGSpringContextTests

Methods: assertEquals

0
	 * expected that the previous increment has been persisted in the database. 
	 */ 
	@Test(dependsOnMethods = "test2IncrementCount1") 
	public void test3IncrementCount2() { 
		int count = dao.getCount(TEST_NAME); 
		assertEquals("Expected count=1 after test2IncrementCount1().", 1, count); 
 
		count = dao.incrementCount(TEST_NAME); 
		assertEquals("Expected count=2 now.", 2, count); 
	} 
 
	@AfterMethod(alwaysRun = true) 
	public void synchronizePersistenceContext() { 
		em.flush(); 
	} 
 
}