Hi,
We are using H2 for end-to-end tests for our JEE application.
So basically the setup is:
* start H2 (in memory) and application server
* run many testcases
* stop H2 and application server
Each testcase brings its own data and clears all tables before running.
Although H2 is pretty fast the setup of the data takes some time.
What I am thinking about is finding a way to start H2 e.g. from a file that contains some prefilled data and then only add the special data the test needs on top.
But I have not found any way to reset the database to the initial state after the test.
Of course copying the file again and restarting H2 would work, but this is probably also slow when running very many tests.
Has anybody a similar setup and have you solved this problem somehow? Running in-memory but backed by a read-only file for example?
Thanks & best regards,
Niklas