补充测试

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@879 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-20 02:39:30 +00:00
parent 588582a612
commit 6f10f670d8
@@ -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);
}
}
}