mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed testcase
This commit is contained in:
+8
-1
@@ -35,6 +35,13 @@ public class MSSQLValidConnectionCheckerTest extends TestCase {
|
||||
MockConnection conn = new MockConnection();
|
||||
conn.setError(new SQLException());
|
||||
|
||||
Assert.assertFalse(checker.isValidConnection(conn, "select 1", 10));
|
||||
SQLException error = null;
|
||||
try {
|
||||
checker.isValidConnection(conn, "select 1", 10);
|
||||
} catch (SQLException ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
Assert.assertSame(error, conn.getError());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user