I would like each test method of the test case to have its own data.
Here is what we are currently doing :
- before each test the database is created
- the sql is inserted in the database (hsqldb or oracle)
- the test method is executed
- the database is dropped
We are going through this loop for all methods in the test case.
As a consequence the file which contains the sql statement contains the SQL needed by all the methods of the test case. This is cumbersom especially when methods are closely related. (assertEquals(1, list.size()) -> assertEquals(2, list.size() for example)
Instead, I would like to have an sql file for each method. To do this I must be able to know what is the method which is going to be executed by JUnit. And I have no idea on how to retreive this value.
Does anyone know how to do this ? or maybe a better idea to isolate the sql between methods ?