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@48 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -6,23 +6,24 @@ import junit.framework.TestCase;
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
|
||||
public class DruidDataSourceFilterTest extends TestCase {
|
||||
|
||||
public void test_filter() throws Exception {
|
||||
DruidDataSource dataSource = new DruidDataSource();
|
||||
|
||||
|
||||
Assert.assertEquals(0, dataSource.getFilters().size());
|
||||
|
||||
|
||||
dataSource.setFilters("stat");
|
||||
|
||||
|
||||
Assert.assertEquals(1, dataSource.getFilters().size());
|
||||
}
|
||||
|
||||
|
||||
public void test_filter_2() throws Exception {
|
||||
DruidDataSource dataSource = new DruidDataSource();
|
||||
|
||||
|
||||
Assert.assertEquals(0, dataSource.getFilters().size());
|
||||
|
||||
|
||||
dataSource.setFilters("stat,trace");
|
||||
|
||||
|
||||
Assert.assertEquals(2, dataSource.getFilters().size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,17 +31,17 @@ import com.jolbox.bonecp.BoneCPDataSource;
|
||||
|
||||
public class Case0 extends TestCase {
|
||||
|
||||
private String jdbcUrl;
|
||||
private String user;
|
||||
private String password;
|
||||
private String driverClass;
|
||||
private int initialSize = 10;
|
||||
private int minPoolSize = 1;
|
||||
private int maxPoolSize = 2;
|
||||
private int maxActive = 2;
|
||||
private String validationQuery = null;
|
||||
|
||||
public final int LOOP_COUNT = 5;
|
||||
private String jdbcUrl;
|
||||
private String user;
|
||||
private String password;
|
||||
private String driverClass;
|
||||
private int initialSize = 10;
|
||||
private int minPoolSize = 1;
|
||||
private int maxPoolSize = 2;
|
||||
private int maxActive = 2;
|
||||
private String validationQuery = null;
|
||||
|
||||
public final int LOOP_COUNT = 5;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
jdbcUrl = "jdbc:fake:dragoon_v25masterdb";
|
||||
@@ -93,14 +93,14 @@ public class Case0 extends TestCase {
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
public void test_2() throws Exception {
|
||||
BoneCPDataSource dataSource = new BoneCPDataSource();
|
||||
// dataSource.(10);
|
||||
// dataSource.setMaxActive(50);
|
||||
dataSource.setMinConnectionsPerPartition(minPoolSize);
|
||||
dataSource.setMaxConnectionsPerPartition(maxPoolSize);
|
||||
|
||||
|
||||
dataSource.setDriverClass(driverClass);
|
||||
dataSource.setJdbcUrl(jdbcUrl);
|
||||
// dataSource.setPoolPreparedStatements(true);
|
||||
@@ -109,7 +109,7 @@ public class Case0 extends TestCase {
|
||||
dataSource.setPassword(password);
|
||||
dataSource.setConnectionTestStatement("SELECT 1");
|
||||
dataSource.setPartitionCount(1);
|
||||
|
||||
|
||||
for (int i = 0; i < LOOP_COUNT; ++i) {
|
||||
p0(dataSource, "boneCP");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user