git-svn-id: http://code.alibabatech.com/svn/druid/trunk@709 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-09 17:01:55 +00:00
parent fe8b5b292f
commit b1c7b6113b
@@ -26,7 +26,7 @@ public class TestRemoveAbandoned extends TestCase {
dataSource.setMinEvictableIdleTimeMillis(300 * 1000); // 300 / 10
dataSource.setTimeBetweenEvictionRunsMillis(10); // 180 / 10
dataSource.setRemoveAbandoned(true);
dataSource.setRemoveAbandonedTimeoutMillis(1);
dataSource.setRemoveAbandonedTimeoutMillis(10);
dataSource.setTestWhileIdle(true);
dataSource.setTestOnBorrow(false);
dataSource.setValidationQuery("SELECT 1");
@@ -41,6 +41,8 @@ public class TestRemoveAbandoned extends TestCase {
Connection conn = dataSource.getConnection();
Assert.assertEquals(1, dataSource.getActiveCount());
Assert.assertEquals(0, dataSource.getPoolingCount());
// 超时之后,连接自动关闭
Thread.sleep(100);
Assert.assertTrue(conn.isClosed());