Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 54254 invoked from network); 8 Feb 2011 18:58:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2011 18:58:25 -0000 Received: (qmail 57163 invoked by uid 500); 8 Feb 2011 18:58:25 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 57100 invoked by uid 500); 8 Feb 2011 18:58:24 -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 57092 invoked by uid 99); 8 Feb 2011 18:58:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Feb 2011 18:58:23 +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; Tue, 08 Feb 2011 18:58:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CD6EC23889DA; Tue, 8 Feb 2011 18:58:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1068524 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java Date: Tue, 08 Feb 2011 18:58:02 -0000 To: derby-commits@db.apache.org From: rhillegas@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110208185802.CD6EC23889DA@eris.apache.org> Author: rhillegas Date: Tue Feb 8 18:58:02 2011 New Revision: 1068524 URL: http://svn.apache.org/viewvc?rev=1068524&view=rev Log: DERBY-4869: Make AutoloadTest aware of the new driver classes introduced by the getParentLogger() work. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java?rev=1068524&r1=1068523&r2=1068524&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/AutoloadTest.java Tue Feb 8 18:58:02 2011 @@ -189,7 +189,7 @@ public class AutoloadTest extends BaseJD */ public void testAutoloadDriverUnregister() throws Exception { if (usingEmbedded()) { - String AutoloadedDriver = "org.apache.derby.jdbc.AutoloadedDriver"; + String AutoloadedDriver = getAutoloadedDriverName(); String Driver40 = "org.apache.derby.jdbc.Driver40"; String Driver30 = "org.apache.derby.jdbc.Driver30"; String Driver20 = "org.apache.derby.jdbc.Driver20"; @@ -228,6 +228,16 @@ public class AutoloadTest extends BaseJD assertFalse(getRegisteredDrivers(Driver20)); } } + private String getAutoloadedDriverName() + { + if ( JDBC.vmSupportsJDBC4() ) { return "org.apache.derby.jdbc.AutoloadedDriver40"; } + else { return "org.apache.derby.jdbc.AutoloadedDriver"; } + } + private String getClientDriverName() + { + if ( JDBC.vmSupportsJDBC4() ) { return "org.apache.derby.jdbc.ClientDriver40"; } + else { return "org.apache.derby.jdbc.ClientDriver"; } + } /** * @throws SQLException @@ -263,6 +273,8 @@ public class AutoloadTest extends BaseJD */ private boolean isEmbeddedDriverRegistered() { + String clientDriverName = getClientDriverName(); + for (Enumeration e = DriverManager.getDrivers(); e.hasMoreElements(); ) { @@ -270,8 +282,10 @@ public class AutoloadTest extends BaseJD String driverClass = d.getClass().getName(); if (!driverClass.startsWith("org.apache.derby.")) continue; - if (driverClass.equals("org.apache.derby.jdbc.ClientDriver")) + if (driverClass.equals( clientDriverName )) continue; + + println( "Found " + driverClass ); // Some form of Derby embedded driver seems to be registered. return true;