How do I delete or delete or cancel or disconnect from my H2 database between test methods?
Here is a bit of my sleep configuration:
<property name="connection.driver_class">org.h2.Driver</property> <property name="connection.url"> jdbc:h2:mem:test;DB_CLOSE_DELAY=0;INIT=RUNSCRIPT FROM './h2-ext/add_to_date.sql' </property> <property name="hbm2ddl.auto">create</property>
I have a base class inheriting all my tests:
public abstract class BaseTest { @After public void drop() throws Exception { System.out.println("!!!!!! DROP !!!!!!&&&&&&&&&&&&&&&&&&&&&&");
It seems like there should be an easy way to perform such an integration test?
Maybe I can use some Transactional annotation? But I would like to know how to do this with a relatively vanilla jersey + JUnit.
Jersey - 2.12, Java 1.7, H2 - 1.4.181, JUnit - 4.11.
Versions are negotiable.
source share