springtestdbunit / spring-test-dbunit

Integration between the Spring testing framework and DBUnit
http://springtestdbunit.github.com/spring-test-dbunit/
Apache License 2.0
475 stars 238 forks source link

Add support to close connection afterTestClass rather than only afterTestMethod #105

Open bmwieczorek opened 8 years ago

bmwieczorek commented 8 years ago

Hi, great tool, we use it a lot. With oracle database we need to run oracle specific queries (prod code) that hsqldb does not support during junit tests. Due to the fact that DbUnitRunner closes the connections after each test method execution: public void afterTestMethod(DbUnitTestContext testContext) throws Exception { try { .... } finally { testContext.getConnections().closeAll(); } } then we cannot reuse the oracle connection (as recommended in http://dbunit.sourceforge.net/bestpractices.html Remote client with DatabaseTestCase) . Creating new oracle connection is very time consuming when dedicated oracle db is remote.

We would greatly appeciate adding new functionality like closeConnectionStrategy.AFTER_TEST_METHOD or AFTER_TEST_CLASS.

Thanks, Bartek

marweck commented 8 years ago

+1 on that