Code example for AbstractTransactionalTestNGSpringContextTests

Methods: deleteFromTables, executeSqlScript

0
		super.run(callBack, testResult); 
	} 
 
	@BeforeTransaction 
	public void beforeTransaction() { 
		deleteFromTables("user"); 
		executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false); 
	} 
 
	@AfterTransaction 
	public void afterTransaction() { 
		switch (method) { 
			case "commitTxAndStartNewTx": 
			case "commitTxButDoNotStartNewTx": { 
				assertUsers("Dogbert"); 
				break; 
			} 
			case "rollbackTxAndStartNewTx": 
			case "rollbackTxButDoNotStartNewTx": 
			case "startTxWithExistingTransaction": {