mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
test
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@709 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user