add testcase & bug fixed for DruidConnectionHolderInitError

This commit is contained in:
wenshao
2012-08-28 09:45:27 +08:00
parent 0c47d2a38d
commit 841534ed43
6 changed files with 189 additions and 8 deletions
@@ -18,7 +18,7 @@ public class DruidConnectionHolderTest extends TestCase {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.setPoolPreparedStatements(true);
dataSource.setInitialSize(1);
dataSource.getProxyFilters().add(new FilterAdapter() {
public int connection_getTransactionIsolation(FilterChain chain, ConnectionProxy connection)
@@ -34,7 +34,8 @@ public class DruidConnectionHolderTest extends TestCase {
}
public void test_mysqlSyntaxError() throws Exception {
Connection conn = dataSource.getConnection();
conn.close();
dataSource.init();
dataSource.getConnection();
}
}