Code example for AbstractTransactionalTestNGSpringContextTests

Methods: run

0
 
 
	@Override 
	public void run(IHookCallBack callBack, ITestResult testResult) { 
		this.method = testResult.getMethod().getMethodName(); 
		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");