1 package org.wamblee.test.persistence;
3 import static junit.framework.Assert.*;
5 import javax.sql.DataSource;
7 import org.junit.After;
8 import org.junit.Before;
10 import org.wamblee.test.persistence.Database;
11 import org.wamblee.test.persistence.DatabaseBuilder;
12 import org.wamblee.test.persistence.DatabaseUtils;
14 public class DatabaseUtilsLeakTest {
17 private DatabaseUtils dbutils;
21 db = DatabaseBuilder.getDatabase();
22 DataSource ds = db.start();
24 dbutils = new DatabaseUtils(ds);
28 public void tearDown() {
33 public void testLeak() throws Exception {
34 assertEquals(0, db.getActiveConnections());
35 dbutils.dropTables(new MyTables());
36 assertEquals(0, db.getActiveConnections());