mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
完善测试
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@815 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.alibaba.druid.bvt.pool.basic;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.Date;
|
||||
import java.sql.Statement;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -44,7 +47,9 @@ public class TestDataSourceBasic extends TestCase {
|
||||
}
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
Assert.assertEquals(true, dataSource.getCreateTimespanNano() > 0);
|
||||
if (dataSource.getCreateCount() > 0) {
|
||||
Assert.assertEquals(true, dataSource.getCreateTimespanNano() > 0);
|
||||
}
|
||||
dataSource.close();
|
||||
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
|
||||
}
|
||||
@@ -84,4 +89,9 @@ public class TestDataSourceBasic extends TestCase {
|
||||
Assert.assertEquals(0, dataSource.getActiveConnectionStackTrace().size());
|
||||
Assert.assertEquals(0, dataSource.getActiveConnections().size());
|
||||
}
|
||||
|
||||
public void test_wrap() throws Exception {
|
||||
Assert.assertTrue(!dataSource.isWrapperFor(Date.class));
|
||||
Assert.assertTrue(dataSource.isWrapperFor(DataSource.class));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user