mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
change default
This commit is contained in:
@@ -21,9 +21,10 @@ import java.util.Properties;
|
||||
|
||||
import javax.security.auth.callback.PasswordCallback;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.druid.mock.MockDriver;
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.pool.DruidPooledConnection;
|
||||
@@ -323,8 +324,17 @@ public class DataSourceTest3 extends TestCase {
|
||||
public void test_error_validateConnection_3() throws Exception {
|
||||
dataSource.setValidationQuery(null);
|
||||
dataSource.setValidConnectionChecker(new MySqlValidConnectionChecker());
|
||||
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
|
||||
|
||||
dataSource.validateConnection(conn);
|
||||
{
|
||||
Exception error = null;
|
||||
try {
|
||||
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
|
||||
dataSource.validateConnection(conn);
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user