From 6f10f670d81c4cb6d3b2cee191944a3696980176 Mon Sep 17 00:00:00 2001 From: wenshao Date: Tue, 20 Sep 2011 02:39:30 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.alibabatech.com/svn/druid/trunk@879 b9813039-fb51-4c41-a8b9-e21c2acb5095 --- .../filter/TraceFilterTest_close_error.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/alibaba/druid/bvt/filter/TraceFilterTest_close_error.java b/src/test/java/com/alibaba/druid/bvt/filter/TraceFilterTest_close_error.java index 4ee15de790..7c6c932e64 100644 --- a/src/test/java/com/alibaba/druid/bvt/filter/TraceFilterTest_close_error.java +++ b/src/test/java/com/alibaba/druid/bvt/filter/TraceFilterTest_close_error.java @@ -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); + } + + } }