Index: src/test/org/apache/commons/dbcp/managed/TestManagedDataSource.java =================================================================== --- src/test/org/apache/commons/dbcp/managed/TestManagedDataSource.java (revision 556144) +++ src/test/org/apache/commons/dbcp/managed/TestManagedDataSource.java (working copy) @@ -126,28 +126,6 @@ connectionB.close(); } - public void testCantCloseConnectionTwice() throws Exception { - // this test is invalid... the JavaDoc and spec for the close method specifically - // state that the close method on an already closed connection is a no-op - } - - - /** - * Verify the close method can be called multiple times on a single connection without - * an exception being thrown. - */ - public void testCanCloseConnectionTwice() throws Exception { - for (int i = 0; i < getMaxActive(); i++) { // loop to show we *can* close again once we've borrowed it from the pool again - Connection conn = newConnection(); - assertTrue(null != conn); - assertTrue(!conn.isClosed()); - conn.close(); - assertTrue(conn.isClosed()); - conn.close(); - assertTrue(conn.isClosed()); - } - } - public void testManagedConnectionEqualsSameDelegate() throws Exception { // Get a maximal set of connections from the pool Connection[] c = new Connection[getMaxActive()]; Index: src/test/org/apache/commons/dbcp/TestManual.java =================================================================== --- src/test/org/apache/commons/dbcp/TestManual.java (revision 556144) +++ src/test/org/apache/commons/dbcp/TestManual.java (working copy) @@ -91,16 +91,20 @@ public void testReportedBug28912() throws Exception { Connection conn1 = getConnection(); assertNotNull(conn1); + assertFalse(conn1.isClosed()); conn1.close(); - + Connection conn2 = getConnection(); assertNotNull(conn2); - - try { - conn1.close(); - fail("Expected SQLException"); - } - catch (SQLException e) { } + + assertTrue(conn1.isClosed()); + assertFalse(conn2.isClosed()); + + // should be able to call close multiple times with no effect + conn1.close(); + + assertTrue(conn1.isClosed()); + assertFalse(conn2.isClosed()); } /** @see http://issues.apache.org/bugzilla/show_bug.cgi?id=12400 */ Index: src/test/org/apache/commons/dbcp/TesterResultSet.java =================================================================== --- src/test/org/apache/commons/dbcp/TesterResultSet.java (revision 556144) +++ src/test/org/apache/commons/dbcp/TesterResultSet.java (working copy) @@ -79,7 +79,9 @@ } public void close() throws SQLException { - checkOpen(); + if (!_open) { + return; + } ((TesterStatement)_statement)._resultSet = null; _open = false; } Index: src/test/org/apache/commons/dbcp/TestConnectionPool.java =================================================================== --- src/test/org/apache/commons/dbcp/TestConnectionPool.java (revision 556144) +++ src/test/org/apache/commons/dbcp/TestConnectionPool.java (working copy) @@ -148,41 +148,96 @@ } } - public void testCantCloseConnectionTwice() throws Exception { - for(int i=0;i