You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2009/09/15 14:53:27 UTC

svn commit: r815303 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java junit/JDBCClient.java junit/JDBCClientSetup.java

Author: rhillegas
Date: Tue Sep 15 12:53:27 2009
New Revision: 815303

URL: http://svn.apache.org/viewvc?rev=815303&view=rev
Log:
DERBY-4359: Make UpgradeTrajectoryTest use the JDBC3 driver when running on Java 6 on trajectories which start before 10.2.2.0.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClient.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClientSetup.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java?rev=815303&r1=815302&r2=815303&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTrajectoryTest.java Tue Sep 15 12:53:27 2009
@@ -41,6 +41,8 @@
 import org.apache.derby.jdbc.EmbeddedDataSource;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.JDBCClient;
+import org.apache.derbyTesting.junit.JDBCClientSetup;
 import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.SecurityManagerSetup;
 import org.apache.derbyTesting.junit.SupportFilesSetup;
@@ -147,6 +149,7 @@
 
     public static Version VERSION_10_0_2_1 = new Version( 10, 0, 2, 1 );
     public static Version VERSION_10_1_3_1 = new Version( 10, 1, 3, 1 );
+    public static Version VERSION_10_2_2_0 = new Version( 10, 2, 2, 0 );
     public static Version VERSION_10_5_1_1 = new Version( 10, 5, 1, 1 );
     public static Version VERSION_10_6_0_0 = new Version( 10, 6, 0, 0 );
 
@@ -433,6 +436,17 @@
         preReleaseUpgrade.setProperty( "derby.database.allowPreReleaseUpgrade", "true");
         
         setup = new SystemPropertyTestSetup(setup, preReleaseUpgrade );
+
+        // If the first release in the trajectory pre-dates the release which
+        // introduced JDBC4, force the client to be the JDBC3 client. This
+        // prevents us from falling through and picking up the JDBC4 data source from
+        // the system classpath rather than picking up a datasource from
+        // the version-specific classloader.
+        if ( trajectory.getVersion( 0 ).compareTo( VERSION_10_2_2_0 ) < 0 )
+        {
+            setup = new JDBCClientSetup( setup, JDBCClient.EMBEDDED_30 );
+        }
+        
         suite.addTest( setup );
     }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClient.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClient.java?rev=815303&r1=815302&r2=815303&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClient.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClient.java Tue Sep 15 12:53:27 2009
@@ -31,7 +31,7 @@
     /**
      * The embedded JDBC client.
      */
-    static final JDBCClient EMBEDDED_30= new JDBCClient(
+    public static final JDBCClient EMBEDDED_30= new JDBCClient(
             "Embedded_30", 
             "org.apache.derby.jdbc.EmbeddedDriver", 
             "org.apache.derby.jdbc.EmbeddedDataSource", 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClientSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClientSetup.java?rev=815303&r1=815302&r2=815303&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClientSetup.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBCClientSetup.java Tue Sep 15 12:53:27 2009
@@ -27,7 +27,7 @@
  * is restored at tearDown time.
  *
  */
-final class JDBCClientSetup extends ChangeConfigurationSetup {
+public final class JDBCClientSetup extends ChangeConfigurationSetup {
 
     private final JDBCClient client;