--- /dev/null
+package org.wamblee.support.persistence;
+
+import javax.sql.DataSource;
+
+import org.dbunit.dataset.DataSetException;
+import org.dbunit.dataset.filter.ITableFilterSimple;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static junit.framework.TestCase.*;
+
+public class DatabaseUtilsLeakTest {
+
+ private Database db;
+ private DatabaseUtils dbutils;
+
+ @Before
+ public void setUp() {
+ db = DatabaseBuilder.getDatabase();
+ DataSource ds = db.start();
+
+ dbutils = new DatabaseUtils(ds, new ITableFilterSimple() {
+ @Override
+ public boolean accept(String aTableName) throws DataSetException {
+ return false;
+ }
+ });
+ }
+
+ @After
+ public void tearDown() {
+ db.stop();
+ }
+
+ @Test
+ public void testLeak() throws Exception {
+ assertEquals(0, db.getActiveConnections());
+ dbutils.dropTables();
+ assertEquals(0, db.getActiveConnections());
+ }
+
+
+}