For now the PurgeDatabaseServlet will be requested in the @AfterClass method.
1. Auto deploy
2. Before class
========= CONTAINER =========
| 3.1 Before
| 3.2 Test
| 3.3 After
| 3.4 Repeat for each Test 1.1 - 1.3
3. After Class
4. Auto undeploy
The report of the database is in this case not necessary, since the database is in this state always unclean!
But we have a clean state afterwards and the next Test class runs on a clean database.
Other solution will include to interrupt the arquillian life cycle after the undeployment. This could be done with the arquillian life cycle extension.
Problem is that the PurgeDatabaseServlet will also be undeployed, so we need to create a new approach. For example listen on a tcp socket or deploy
in another way. The current approach to clean the database in the @AfterClass fits at this time best (is also less effort).
We had to remove the TestJarDeployment since this test class fails randomly and we did not find a solution to fix this issue.