use of com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker in project druid by alibaba.
the class MSSQLValidConnectionCheckerTest method test_closed.
public void test_closed() throws Exception {
MSSQLValidConnectionChecker checker = new MSSQLValidConnectionChecker();
MockConnection conn = new MockConnection();
conn.close();
Assert.assertFalse(checker.isValidConnection(conn, "select 1", 10));
}
use of com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker in project druid by alibaba.
the class MSSQLValidConnectionCheckerTest method test_error.
public void test_error() throws Exception {
MSSQLValidConnectionChecker checker = new MSSQLValidConnectionChecker();
MockConnection conn = new MockConnection();
conn.setError(new SQLException());
SQLException error = null;
try {
checker.isValidConnection(conn, "select 1", 10);
} catch (SQLException ex) {
error = ex;
}
Assert.assertNotNull(error);
Assert.assertSame(error, conn.getError());
}
use of com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker in project druid by alibaba.
the class MSSQLValidConnectionCheckerTest method test_0.
public void test_0() throws Exception {
MSSQLValidConnectionChecker checker = new MSSQLValidConnectionChecker();
MockConnection conn = new MockConnection();
Assert.assertTrue(checker.isValidConnection(conn, "select 1", 10));
}
Aggregations