Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 320E4200B3B for ; Mon, 11 Jul 2016 23:55:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3093E160A78; Mon, 11 Jul 2016 21:55:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7B142160A5E for ; Mon, 11 Jul 2016 23:55:55 +0200 (CEST) Received: (qmail 79697 invoked by uid 500); 11 Jul 2016 21:55:54 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 79688 invoked by uid 99); 11 Jul 2016 21:55:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2016 21:55:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 45592DFFF8; Mon, 11 Jul 2016 21:55:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: andygumbrecht@apache.org To: commits@tomee.apache.org Message-Id: <2caec834531749ca8f4e8d6616565527@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: tomee git commit: https://issues.apache.org/jira/browse/TOMEE-1860 - Test for close Date: Mon, 11 Jul 2016 21:55:54 +0000 (UTC) archived-at: Mon, 11 Jul 2016 21:55:56 -0000 Repository: tomee Updated Branches: refs/heads/tomee-1.7.x f7c17bf48 -> 2540c683d https://issues.apache.org/jira/browse/TOMEE-1860 - Test for close Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2540c683 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2540c683 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2540c683 Branch: refs/heads/tomee-1.7.x Commit: 2540c683d0bfdeb476e870a05e993d09c85d2598 Parents: f7c17bf Author: AndyGee Authored: Mon Jul 11 23:55:39 2016 +0200 Committer: AndyGee Committed: Mon Jul 11 23:55:39 2016 +0200 ---------------------------------------------------------------------- .../openejb/resource/jdbc/DbcpNPEXAConnectionTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/2540c683/container/openejb-core/src/test/java/org/apache/openejb/resource/jdbc/DbcpNPEXAConnectionTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/resource/jdbc/DbcpNPEXAConnectionTest.java b/container/openejb-core/src/test/java/org/apache/openejb/resource/jdbc/DbcpNPEXAConnectionTest.java index 8aaaed6..5681058 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/resource/jdbc/DbcpNPEXAConnectionTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/resource/jdbc/DbcpNPEXAConnectionTest.java @@ -85,7 +85,9 @@ public class DbcpNPEXAConnectionTest { @Test public void check() throws SQLException { - ejb.newConn().close(); // no NPE + final Connection con = ejb.newConn(); + con.close(); // no NPE + Assert.assertTrue("Connection was not closed", con.isClosed()); final GenericObjectPool pool = GenericObjectPool.class.cast(Reflections.get(ds, "connectionPool")); assertEquals(0, pool.getNumActive()); } @@ -96,7 +98,9 @@ public class DbcpNPEXAConnectionTest { private DataSource ds; public Connection newConn() throws SQLException { - ds.getConnection().close(); // first connection is not "shared" so closes correctly + final Connection con = ds.getConnection(); + con.close(); // first connection is not "shared" so closes correctly + Assert.assertTrue("Connection was not closed", con.isClosed()); return use(ds.getConnection()); // this one is shared so delegate will be null and close outside JTA will fail } }