db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r494201 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests: BasicSetup.java Changes10_1.java Changes10_2.java Changes10_3.java UpgradeChange.java UpgradeRun.java _Suite.java
Date Mon, 08 Jan 2007 21:23:28 GMT
Author: djd
Date: Mon Jan  8 13:23:27 2007
New Revision: 494201

URL: http://svn.apache.org/viewvc?view=rev&rev=494201
Log:
DERBY-2217 (partial) Convert some of the test cases added in 10.2 and 10.3 to the
JUnit upgrade tester.
Change the setup so that the POST_HARD_UPGRADE phase does
not add any fixtures as no connection should be obtained in this mode. This simplifies
most fixtures to not special case the POST_HARD_UPGRADE phase. Explict testing of
this phase still needs to be added.
Have the _Suite skip all tests if the location of the old released jars is not specified.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
  (with props)
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_1.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java?view=diff&rev=494201&r1=494200&r2=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java
Mon Jan  8 13:23:27 2007
@@ -21,7 +21,9 @@
 package org.apache.derbyTesting.functionTests.tests.upgradeTests;
 
 import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.sql.Statement;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -54,11 +56,74 @@
         case PH_CREATE:
         case PH_POST_SOFT_UPGRADE:
             DatabaseMetaData dmd = getConnection().getMetaData();
-            assertEquals("Old major: ",
+            assertEquals("Old major (driver): ",
                     getOldMajor(), dmd.getDriverMajorVersion());
-            assertEquals("Old minor: ",
+            assertEquals("Old minor (driver): ",
                     getOldMinor(), dmd.getDriverMinorVersion());
+            assertEquals("Old major (database): ",
+                    getOldMajor(), dmd.getDatabaseMajorVersion());
+            assertEquals("Old minor (database): ",
+                    getOldMinor(), dmd.getDatabaseMinorVersion());
             break;
         }
+    }
+    
+    /**
+     * Test general DML. Just execute some INSERT/UPDATE/DELETE
+     * statements in all phases to see that generally the database works.
+     * @throws SQLException
+     */
+    public void testDML() throws SQLException {
+        
+        final int phase = getPhase();
+        
+        Statement s = createStatement();
+        
+        switch (phase) {
+        case PH_CREATE:
+            s.executeUpdate("CREATE TABLE PHASE" +
+                                                "(id INT NOT NULL, ok INT)");
+            s.executeUpdate("CREATE TABLE TABLE1" +
+                        "(id INT NOT NULL PRIMARY KEY, name varchar(200))");
+            break;
+        case PH_SOFT_UPGRADE:
+            break;
+        case PH_POST_SOFT_UPGRADE:
+            break;
+        case PH_HARD_UPGRADE:
+            break;
+        }
+        s.close();
+    
+        PreparedStatement ps = prepareStatement(
+                "INSERT INTO PHASE(id) VALUES (?)");
+        ps.setInt(1, phase);
+        ps.executeUpdate();
+        ps.close();
+        
+        ps = prepareStatement("INSERT INTO TABLE1 VALUES (?, ?)");
+        for (int i = 1; i < 20; i++)
+        {
+            ps.setInt(1, i + (phase * 100));
+            ps.setString(2, "p" + phase + "i" + i);
+            ps.executeUpdate();
+        }
+        ps.close();
+        ps = prepareStatement("UPDATE TABLE1 set name = name || 'U' " +
+                                    " where id = ?");
+        for (int i = 1; i < 20; i+=3)
+        {
+            ps.setInt(1, i + (phase * 100));
+            ps.executeUpdate();
+        }
+        ps.close();
+        ps = prepareStatement("DELETE FROM TABLE1 where id = ?");
+        for (int i = 1; i < 20; i+=4)
+        {
+            ps.setInt(1, i + (phase * 100));
+            ps.executeUpdate();
+        }
+        ps.close();
+        commit();
     }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_1.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_1.java?view=diff&rev=494201&r1=494200&r2=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_1.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_1.java
Mon Jan  8 13:23:27 2007
@@ -20,6 +20,9 @@
 */
 package org.apache.derbyTesting.functionTests.tests.upgradeTests;
 
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
@@ -28,6 +31,13 @@
 
 /**
  * Upgrade test cases for changes made in 10.1.
+ * <BR>
+    10.1 Upgrade issues
+
+    <UL>
+    <LI> testProcedureSignature - Routines with explicit Java signatures.
+    </UL>
+
  */
 public class Changes10_1 extends UpgradeChange {
     

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java?view=auto&rev=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java
Mon Jan  8 13:23:27 2007
@@ -0,0 +1,216 @@
+/*
+
+Derby - Class org.apache.derbyTesting.functionTests.tests.upgradeTests.Changes10_2
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+*/
+package org.apache.derbyTesting.functionTests.tests.upgradeTests;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.derbyTesting.junit.JDBC;
+
+/**
+ * Upgrade test cases for changes made in 10.2.
+ * <BR>
+ * 10.2 Upgrade issues
+ * <UL>
+ * <LI> testTriggerInternalVTI - Check internal re-write of triggers
+ * does not break triggers in soft upgrade mode.
+ * <LI> testReusableRecordIdSequenceNumber - Test reuseable record
+ * identifiers does not cause issues in soft upgrade
+ * </UL>
+ */
+public class Changes10_2 extends UpgradeChange {
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite("Upgrade changes for 10.2");
+        
+        suite.addTestSuite(Changes10_2.class);
+        
+        return suite;
+    }
+
+    public Changes10_2(String name) {
+        super(name);
+    }
+    
+    /**
+     * Triger (internal) VTI
+     * 10.2 - Check that a statement trigger created in 10.0
+     * or 10.1 can be executed in 10.2 and that a statement
+     * trigger created in soft upgrade in 10.2 can be used
+     * in older releases.
+     * 
+     * The VTI implementing statement triggers changed in
+     * 10.2 from implementations of ResultSet to implementations
+     * of PreparedStatement. See DERBY-438. The internal
+     * api for the re-written action statement remains the
+     * same. The re-compile of the trigger on version changes
+     * should automatically switch between the two implementations.
+     *
+     * @param conn Connection
+     * @param phase Upgrade test phase
+     * @param dbMajor Major version of old release 
+     * @param dbMinor Minor version of old release
+     * @return true, if the test passes
+     * @throws SQLException
+     */
+    public void testTriggerInternalVTI()
+                                    throws SQLException {
+                
+        
+        Statement s = createStatement();
+
+        boolean modeDb2SqlOptional = oldAtLeast(10, 3);
+
+        switch (getPhase()) {
+        case PH_CREATE:
+            s.execute("CREATE TABLE D438.T438(a int, b varchar(20), c int)");
+            s.execute("INSERT INTO D438.T438 VALUES(1, 'DERBY-438', 2)");
+            s.execute("CREATE TABLE D438.T438_T1(a int, b varchar(20))");
+            s.execute("CREATE TABLE D438.T438_T2(a int, c int)");
+            s.execute(
+               "create trigger D438.T438_ROW_1 after UPDATE on D438.T438 " +
+               "referencing new as n old as o " + 
+               "for each row "+ 
+               (modeDb2SqlOptional?"":"mode db2sql ") +
+               "insert into D438.T438_T1(a, b) values (n.a, n.b || '_ROW')");
+            s.executeUpdate(
+               "create trigger D438.T438_STMT_1 after UPDATE on D438.T438 " +
+               "referencing new_table as n " + 
+               "for each statement "+ 
+               (modeDb2SqlOptional?"":"mode db2sql ") +
+               "insert into D438.T438_T1(a, b) select n.a, n.b || '_STMT' from n"); 
+            
+            commit();
+            break;
+            
+        case PH_SOFT_UPGRADE:
+            s.execute(
+               "create trigger D438.T438_ROW_2 after UPDATE on D438.T438 " +
+               "referencing new as n old as o " + 
+               "for each row "+ 
+               (modeDb2SqlOptional?"":"mode db2sql ") +
+               "insert into D438.T438_T2(a, c) values (n.a, n.c + 100)");
+             s.executeUpdate(
+                "create trigger D438.T438_STMT_2 after UPDATE on D438.T438 " +
+                "referencing new_table as n " + 
+                "for each statement "+ 
+               (modeDb2SqlOptional?"":"mode db2sql ") +
+                "insert into D438.T438_T2(a, c) select n.a, n.c + 4000 from n"); 
+                 
+            commit();
+            break;
+        case PH_POST_SOFT_UPGRADE:
+            break;
+        case PH_HARD_UPGRADE:
+           break;
+        }
+        
+        // Test the firing of the triggers
+        s.executeUpdate("UPDATE D438.T438 set c = c + 1");
+        commit();
+        
+        ResultSet rs = s.executeQuery("SELECT a,b from D438.T438_T1 ORDER BY 2");
+        JDBC.assertFullResultSet(rs, new String[][]
+                {{"1", "DERBY-438_ROW"},
+                {"1", "DERBY-438_STMT"}});
+        rs.close();
+        
+        rs = s.executeQuery("SELECT a,c from D438.T438_T2 ORDER BY 2");
+        if (getPhase() == PH_CREATE)
+        {
+            // expect no rows since the trigger that populates
+            // the table is defined in soft upgrade.
+            assertFalse(rs.next());
+        }
+        else
+        {
+            JDBC.assertFullResultSet(rs, new String[][] {
+                    {"1", Integer.toString(2 + 100 + getPhase() + 1)},
+                    {"1", Integer.toString(2 + 4000 + getPhase() + 1)}});
+            
+        }
+        rs.close();
+            
+        s.executeUpdate("DELETE FROM D438.T438_T1");
+        s.executeUpdate("DELETE FROM D438.T438_T2");
+        commit();
+       
+        s.close();
+    }
+    
+    /**
+     * In 10.2: We will write a ReusableRecordIdSequenceNumber in the 
+     * header of a FileContaienr.
+     * 
+     * Verify here that a 10.1 Database does not malfunction from this.
+     * 10.1 Databases should ignore the field.
+     */
+    public void testReusableRecordIdSequenceNumber()
+        throws SQLException
+    {
+        boolean runCompress = oldAtLeast(10, 1);
+
+        switch(getPhase()) {
+        case PH_CREATE: {
+            Statement s = createStatement();
+            s.execute("create table CT1(id int)");
+            s.execute("insert into CT1 values 1,2,3,4,5,6,7,8,9,10");
+            s.close();
+            commit();
+            break;
+        }
+        case PH_SOFT_UPGRADE:
+            if (runCompress) {
+                PreparedStatement ps = prepareStatement
+                    ("call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(?,?,?,?,?)");
+                ps.setString(1, "APP"); // schema
+                ps.setString(2, "CT1");  // table name
+                ps.setInt(3, 1); // purge
+                ps.setInt(4, 1); // defragment rows
+                ps.setInt(5, 1); // truncate end
+                ps.executeUpdate();
+                ps.close();
+               commit();
+            }
+            break;
+        case PH_POST_SOFT_UPGRADE: {
+            // We are now back to i.e 10.1
+            Statement s = createStatement();
+            ResultSet rs = s.executeQuery("select * from CT1");
+            while (rs.next()) {
+                rs.getInt(1);
+            }
+            s.execute("insert into CT1 values 11,12,13,14,15,16,17,18,19");
+            s.close();
+            commit();
+            break;
+        }
+        case PH_HARD_UPGRADE:
+            break;
+        }
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java?view=auto&rev=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
Mon Jan  8 13:23:27 2007
@@ -0,0 +1,82 @@
+/*
+
+Derby - Class org.apache.derbyTesting.functionTests.tests.upgradeTests.Changes10_3
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+*/
+package org.apache.derbyTesting.functionTests.tests.upgradeTests;
+
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Upgrade test cases for changes made in 10.3.
+ * <BR>
+ * 10.3 Upgrade issues
+ */
+public class Changes10_3 extends UpgradeChange {
+    
+    public static Test suite() {
+        TestSuite suite = new TestSuite("Upgrade changes for 10.3");
+        
+        suite.addTestSuite(Changes10_3.class);
+        
+        return suite;
+    }
+
+    public Changes10_3(String name) {
+        super(name);
+    }
+    
+
+    
+    /**
+     * Verify the compilation schema is nullable after upgrade to 10.3
+     * or later. (See DERBY-630)
+     * @throws SQLException
+     */
+    public void testCompilationSchema() throws SQLException
+    {        
+       switch (getPhase())
+        {
+            case PH_CREATE:
+            case PH_POST_SOFT_UPGRADE:
+            case PH_POST_HARD_UPGRADE:
+                // 10.0-10.2 inclusive had the system schema incorrect.
+                if (!oldAtLeast(10, 3))
+                    return;
+                break;
+        }
+
+        DatabaseMetaData dmd = getConnection().getMetaData();
+
+        ResultSet rs = dmd.getColumns(null, "SYS", "SYSSTATEMENTS", "COMPILATIONSCHEMAID");
+        rs.next();
+        assertEquals("SYS.SYSSTATEMENTS.COMPILATIONSCHEMAID IS_NULLABLE",
+                        "YES", rs.getString("IS_NULLABLE"));
+        rs.close();
+
+        rs = dmd.getColumns(null, "SYS", "SYSVIEWS", "COMPILATIONSCHEMAID");
+        rs.next();
+        assertEquals("SYS.SYSVIEWS.COMPILATIONSCHEMAID IS_NULLABLE",
+                        "YES", rs.getString("IS_NULLABLE"));
+    }
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java?view=diff&rev=494201&r1=494200&r2=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeChange.java
Mon Jan  8 13:23:27 2007
@@ -114,4 +114,13 @@
             return true;
         return false;
     } 
+    /**
+     * Return true if the old version is equal
+     *  the passed in major and minor version.
+     */
+    boolean oldIs(int requiredMajor, int requiredMinor) 
+    {
+        return (getOldMajor() == requiredMajor)
+          && (getOldMinor() == requiredMinor);
+     } 
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java?view=diff&rev=494201&r1=494200&r2=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
Mon Jan  8 13:23:27 2007
@@ -64,8 +64,6 @@
 
     public final static Test suite(final int[] version) {
         
-        TestSuite suite = new TestSuite(
-                "Upgrade Tests from " + getTextVersion(version));
         
         ClassLoader oldLoader = (ClassLoader )AccessController.doPrivileged
         (new java.security.PrivilegedAction(){
@@ -78,6 +76,19 @@
         }
          );
         
+        // If no jars then just skip.
+        if (oldLoader == null)
+        {
+            TestSuite suite = new TestSuite(
+                    "Empty: Skipped upgrade Tests (no jars) for " + getTextVersion(version));
+            return suite;
+        }
+        
+        
+        TestSuite suite = new TestSuite(
+                "Upgrade Tests from " + getTextVersion(version));
+
+        
         for (int phase = 0;
               phase < UpgradeChange.PHASES.length; phase++)
         {
@@ -95,7 +106,8 @@
                 
             }
             Test phaseTests = baseSuite(
-                    "Upgrade Phase: " + UpgradeChange.PHASES[phase]);
+                    "Upgrade Phase: " + UpgradeChange.PHASES[phase],
+                    phase);
             
             suite.addTest(new PhaseChanger(phaseTests, phase, loader, version));
         }
@@ -111,12 +123,19 @@
         return SecurityManagerSetup.noSecurityManager(setup);
     }
     
-    private static Test baseSuite(String name) {
+    private static Test baseSuite(String name, int phase) {
         TestSuite suite = new TestSuite(name);
-        
-        suite.addTest(BasicSetup.suite());
-        
-        suite.addTest(Changes10_1.suite());
+          
+        // No connection is expected in the post hard upgrade
+        // phase, so don't bother adding test fixtures.
+        if (phase != UpgradeChange.PH_POST_HARD_UPGRADE)
+        {
+            suite.addTest(BasicSetup.suite());
+            
+            suite.addTest(Changes10_1.suite());
+            suite.addTest(Changes10_2.suite());
+            suite.addTest(Changes10_3.suite());
+        }
                 
         return TestConfiguration.connectionDSDecorator(suite);
     }
@@ -152,10 +171,17 @@
         
         String jarLocation = getOldJarLocation(version);
         
+        File lib = new File(jarLocation);
+        
+        // If the jars do not exist then return null
+        // and the caller will set up to skip this.
+        if (!lib.exists())
+            return null;
+        
+        
         for (int i=0; i < jarFiles.length; i++) {
             try {
-                url[i] = new File(jarLocation + File.separator + jarFiles[i]).toURL();
-                System.out.println("URL " + url[i].toString());
+                url[i] = new File(lib, jarFiles[i]).toURL();
             } catch (MalformedURLException e) {
                 Assert.fail(e.toString());
             }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java?view=diff&rev=494201&r1=494200&r2=494201
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/_Suite.java
Mon Jan  8 13:23:27 2007
@@ -28,18 +28,63 @@
 /**
  * Run the full upgrade suite. This is the only
  * way to run tests in this package.
- *
+ * A set of tests are run against a number of
+ * previous releases, see the static OLD_VERSIONS
+ * field in this class.
+ * 
+ * Each test against the old release consists of following phases:
+   
+    <OL>
+    <LI> Create database with the <B>old</B> release.
+    <LI> Boot the database with the <B>new</B> release in soft upgrade
mode.
+    Try to execute functionality that is not allowed in soft upgrade.
+    <LI> Boot the database with the <B>old</B> release to ensure the
+    database can be booted by the old release after soft upgrade.
+    <LI> Boot the database with the <B>new</B> release in hard upgrade
mode,
+    specifying the upgrade=true attribute.
+    <LI> Boot the database with the <B>old</B> release to ensure the
+    database can not be booted by the old release after hard upgrade.
+    </OL>
+    The class PhaseChanger is the decorator that sets up the
+    fixtures to run in a given phase.
+
+    <P>
+    The test fixtures themseleves are in JUnit test classes
+    that are sub-classes of UpgradeChange. The set of fixtures
+    in BasicSetup is general setup and the changes per release
+    are in classes of the form Changes10_1 etc.
+    
+    <P>
+    The class UpgradeRun hooks up the test fixtures for a set
+    of runs against a single old release into a single suite.
+    Each fixture is run multiple times, once per phase against
+    each old release.
+    
+    @see UpgradeRun
+    @see UpgradeChange
  */
 public class _Suite extends BaseTestCase {
     
+    /**
+     * List of the versions to test against.
+     * The tests look for the jar files in each releasae
+     * in the folder:
+     * ${derbyTesting.jar.path}/M.m.f.p/lib
+     * 
+     * If derbyTesting.jar.path is not set then no tests will be run.
+     * 
+     * If ${derbyTesting.jar.path}/M.m.f.p/lib does not exist
+     * for a specific release then those sets of tests will
+     * be skipped.
+     */
     private static final int[][] OLD_VERSIONS =
     {
-        // {10, 0, 2, 1}, // 10.0.2.1 (incubator release)
+        {10, 0, 2, 1}, // 10.0.2.1 (incubator release)
         {10, 1, 1, 0}, // 10.1.1.0 (Aug 3, 2005 / SVN 208786)
         {10, 1, 2, 1}, // 10.1.2.1 (Nov 18, 2005 / SVN 330608)
         {10, 1, 3, 1}, // 10.1.3.1 (Jun 30, 2006 / SVN 417277)
-        // {10, 2, 1, 6}, // 10.2.1.6 (Oct 02, 2006 / SVN 452058)
-        // {10, 2, 1, 6}, // 10.2.2.0 (Dec 12, 2006 / SVN 485682)
+        {10, 2, 1, 6}, // 10.2.1.6 (Oct 02, 2006 / SVN 452058)
+        {10, 2, 2, 0}, // 10.2.2.0 (Dec 12, 2006 / SVN 485682)
     };
 
 
@@ -51,6 +96,10 @@
     }
     
     public static Test suite() {
+        
+        if (getSystemProperty("derbyTesting.jar.path") == null)
+            return new TestSuite(
+                    "empty: no upgrade tests: derbyTesting.jar.path not set");
         
         TestSuite suite = new TestSuite("Upgrade Suite");       
 



Mime
View raw message