mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.alibaba.druid.pool;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.Statement;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
@@ -14,6 +15,8 @@ public class TestMockPerf extends TestCase {
|
||||
dataSource.setInitialSize(3);
|
||||
dataSource.setMinIdle(3);
|
||||
dataSource.setMaxActive(20);
|
||||
dataSource.setDbType("mysql");
|
||||
dataSource.setFilters("stat,wall");
|
||||
dataSource.init();
|
||||
}
|
||||
|
||||
@@ -29,6 +32,9 @@ public class TestMockPerf extends TestCase {
|
||||
public void perf() throws Exception {
|
||||
for (int i = 0; i < 1000 * 1000; ++i) {
|
||||
Connection conn = dataSource.getConnection();
|
||||
Statement stmt = conn.createStatement();
|
||||
stmt.execute("SELECT 1");
|
||||
stmt.close();
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user