mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
完善mock和测试
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@832 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -36,7 +36,8 @@ public class ConnectionTest5 extends TestCase {
|
||||
dataSource.setMinEvictableIdleTimeMillis(300 * 1000); // 300 / 10
|
||||
dataSource.setTimeBetweenEvictionRunsMillis(180 * 1000); // 180 / 10
|
||||
dataSource.setTestWhileIdle(true);
|
||||
dataSource.setTestOnBorrow(false);
|
||||
dataSource.setTestOnBorrow(true);
|
||||
dataSource.setTestOnReturn(true);
|
||||
dataSource.setValidationQuery("SELECT 1");
|
||||
dataSource.setFilters("stat,trace");
|
||||
|
||||
|
||||
@@ -15,4 +15,12 @@ public class PoolableWrapperTest extends TestCase {
|
||||
Assert.assertEquals(true, wrapper.isWrapperFor(PoolableWrapper.class));
|
||||
Assert.assertEquals(true, wrapper.isWrapperFor(MockConnection.class));
|
||||
}
|
||||
|
||||
public void test_unwrap() throws Exception {
|
||||
PoolableWrapper wrapper = new PoolableWrapper(new MockConnection());
|
||||
|
||||
Assert.assertEquals(null, wrapper.unwrap(null));
|
||||
Assert.assertEquals(true, wrapper.unwrap(PoolableWrapper.class) != null);
|
||||
Assert.assertEquals(true, wrapper.unwrap(MockConnection.class) != null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user