mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
补充测试
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@879 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -55,7 +55,7 @@ public class TraceFilterTest_close_error extends TestCase {
|
||||
JdbcStatManager.getInstance().setStatContext(null);
|
||||
}
|
||||
|
||||
public void test_exuecute() throws Exception {
|
||||
public void test_close_error() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
MockConnection conn = new MockConnection() {
|
||||
@@ -75,4 +75,25 @@ public class TraceFilterTest_close_error extends TestCase {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void test_close_error_2() throws Exception {
|
||||
FilterChainImpl chain = new FilterChainImpl(dataSource);
|
||||
|
||||
MockConnection conn = new MockConnection() {
|
||||
public void close() throws SQLException {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
};
|
||||
|
||||
{
|
||||
Exception error = null;
|
||||
try {
|
||||
filter.connection_close(chain, new ConnectionProxyImpl(dataSource, conn, new Properties(), 0));
|
||||
} catch (Exception ex) {
|
||||
error = ex;
|
||||
}
|
||||
Assert.assertNotNull(error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user