test fixed

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@724 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-10 18:17:47 +00:00
parent 5419f2af74
commit 86ea864b5a
2 changed files with 7 additions and 1 deletions
@@ -8,8 +8,12 @@ import junit.framework.Assert;
import junit.framework.TestCase;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.stat.DruidDataSourceStatManager;
public class TestClose_2 extends TestCase {
protected void tearDown() throws Exception {
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
}
public void test_close() throws Exception {
DruidDataSource dataSource = new DruidDataSource();
@@ -10,6 +10,7 @@ import junit.framework.TestCase;
import com.alibaba.druid.mock.MockDriver;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.stat.DruidDataSourceStatManager;
public class TestConcurrent extends TestCase {
@@ -41,6 +42,7 @@ public class TestConcurrent extends TestCase {
protected void tearDown() throws Exception {
dataSource.close();
Assert.assertEquals(0, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
}
public void test_0() throws Exception {
@@ -79,7 +81,7 @@ public class TestConcurrent extends TestCase {
}
// 使用单个线程模拟并发打开10个连接
for (int i = 0; i < 1000 * 10; ++i) {
for (int i = 0; i < 1000 * 1; ++i) {
final int COUNT = 10;
Connection[] connections = new Connection[COUNT];