use of com.alibaba.druid.pool.DruidPooledConnection in project druid by alibaba.
the class DataSourceTest3 method test_error_10.
public void test_error_10() throws Exception {
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
conn.close();
{
Exception error = null;
try {
dataSource.addConnectionProperty("x", "11");
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}
}
use of com.alibaba.druid.pool.DruidPooledConnection in project druid by alibaba.
the class DataSourceTest3 method test_error_12.
public void test_error_12() throws Exception {
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
conn.close();
{
Exception error = null;
try {
dataSource.setDriverClassName("");
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}
}
use of com.alibaba.druid.pool.DruidPooledConnection in project druid by alibaba.
the class DataSourceTest3 method test_error_validateConnection_3.
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);
}
use of com.alibaba.druid.pool.DruidPooledConnection in project druid by alibaba.
the class DataSourceTest3 method test_error_7.
public void test_error_7() throws Exception {
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
conn.close();
dataSource.setPassword(dataSource.getPassword());
dataSource.setPassword("xx");
}
use of com.alibaba.druid.pool.DruidPooledConnection in project druid by alibaba.
the class DataSourceTest3 method test_prepareStatement_error.
public void test_prepareStatement_error() throws Exception {
DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);
conn.close();
{
Exception error = null;
try {
dataSource.setUsername("xxx");
} catch (Exception ex) {
error = ex;
}
Assert.assertNotNull(error);
}
}
Aggregations