mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed testcase failed
This commit is contained in:
@@ -30,10 +30,10 @@ public class OnFatalErrorMaxActiveTest extends PoolTestCase {
|
||||
Field field = DruidAbstractDataSource.class.getDeclaredField("onFatalError");
|
||||
field.setAccessible(true);
|
||||
|
||||
SQLException faltalError = new SQLException();
|
||||
{
|
||||
SQLException faltalError = null;
|
||||
for ( int i = 0; i < 2; i++) {
|
||||
faltalError = new SQLException();
|
||||
Connection conn = dataSource.getConnection();
|
||||
|
||||
Method method = DruidDataSource.class.getDeclaredMethod("handleFatalError", DruidPooledConnection.class, SQLException.class, String.class);
|
||||
method.setAccessible(true);
|
||||
method.invoke(dataSource, conn.unwrap(DruidPooledConnection.class), faltalError, "select 'x'");
|
||||
|
||||
@@ -30,8 +30,9 @@ public class OnFatalErrorMaxActiveTest_1 extends PoolTestCase {
|
||||
Field field = DruidAbstractDataSource.class.getDeclaredField("onFatalError");
|
||||
field.setAccessible(true);
|
||||
|
||||
SQLException faltalError = new SQLException();
|
||||
{
|
||||
SQLException faltalError = null;
|
||||
for ( int i = 0; i < 2; i++) {
|
||||
faltalError = new SQLException();
|
||||
Connection conn = dataSource.getConnection();
|
||||
|
||||
Method method = DruidDataSource.class.getDeclaredMethod("handleFatalError", DruidPooledConnection.class, SQLException.class, String.class);
|
||||
|
||||
Reference in New Issue
Block a user