Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DA54D3A2 for ; Mon, 11 Mar 2013 17:07:48 +0000 (UTC) Received: (qmail 63410 invoked by uid 500); 11 Mar 2013 17:07:48 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 63368 invoked by uid 500); 11 Mar 2013 17:07:46 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 63342 invoked by uid 99); 11 Mar 2013 17:07:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Mar 2013 17:07:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Mar 2013 17:07:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7C2242388847; Mon, 11 Mar 2013 17:07:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1455238 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java Date: Mon, 11 Mar 2013 17:07:25 -0000 To: derby-commits@db.apache.org From: rhillegas@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130311170725.7C2242388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhillegas Date: Mon Mar 11 17:07:25 2013 New Revision: 1455238 URL: http://svn.apache.org/r1455238 Log: DERBY-6094: Further cleanup of LoginTimeoutTest. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java?rev=1455238&r1=1455237&r2=1455238&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LoginTimeoutTest.java Mon Mar 11 17:07:25 2013 @@ -270,7 +270,8 @@ public class LoginTimeoutTest extends Ba // make sure the database is created in order to eliminate asymmetries // in running the tests - openDefaultConnection( RUTH, RUTH_PASSWORD ); + Connection conn = openDefaultConnection( RUTH, RUTH_PASSWORD ); + conn.close(); vetConnector( new DriverManagerConnector( this ), true ); vetConnector( new DataSourceConnector( JDBCDataSource.getDataSource() ), true ); @@ -307,11 +308,12 @@ public class LoginTimeoutTest extends Ba try { Connection conn = connector.getConnection( RUTH, RUTH_PASSWORD ); println( " Got a " + conn.getClass().getName() ); + conn.close(); if ( !shouldSucceed ) { fail( "Should not have been able to connect!" ); } } catch (SQLException se) { - if ( shouldSucceed ) { failWithTrace( se, "Should have been able to connect!" ); } + if ( shouldSucceed ) { fail( "Should have been able to connect!", se ); } assertTrue( "Didn't expect to see a " + se.getClass().getName(), (se instanceof SQLTimeoutException) ); assertSQLState( LOGIN_TIMEOUT, se ); @@ -332,7 +334,8 @@ public class LoginTimeoutTest extends Ba SluggishAuthenticator.returnValue = false; try { - openDefaultConnection( RUTH, RUTH_PASSWORD ); + Connection conn = openDefaultConnection( RUTH, RUTH_PASSWORD ); + conn.close(); fail( "Didn't expect to get a connection!" ); } catch (SQLException se) { assertSQLState( LOGIN_FAILED, se ); } @@ -365,6 +368,7 @@ public class LoginTimeoutTest extends Ba // reset server timeout to default setServerTimeout( controlConnection, 0 ); + controlConnection.close(); } private void vetServerTimeout ( Connection controlConnection, Connector connector, int serverTimeout, boolean shouldSucceed ) @@ -399,11 +403,4 @@ public class LoginTimeoutTest extends Ba // /////////////////////////////////////////////////////////////////////////////////// - /** Fail and print a stack trace */ - private static void failWithTrace( Throwable t, String message ) - { - printStackTrace( t ); - fail( message ); - } - }