db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
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 GMT
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;



Mime
View raw message