db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r537728 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java
Date Mon, 14 May 2007 06:30:01 GMT
Author: myrnavl
Date: Sun May 13 23:30:00 2007
New Revision: 537728

URL: http://svn.apache.org/viewvc?view=rev&rev=537728
Log:
DERBY-2612 - making running of DatabaseMetaDataTest in upgrade test more selective - not all
fixtures can be run with all older versions.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeRun.java

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=537728&r1=537727&r2=537728
==============================================================================
--- 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
Sun May 13 23:30:00 2007
@@ -21,6 +21,7 @@
 package org.apache.derbyTesting.functionTests.tests.upgradeTests;
 
 import java.io.File;
+import java.lang.reflect.Method;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -221,7 +222,7 @@
             // of DatabaseMetaData should be available.
             case UpgradeChange.PH_SOFT_UPGRADE:
             case UpgradeChange.PH_HARD_UPGRADE:
-                suite.addTestSuite(DatabaseMetaDataTest.class);
+                RunDataBaseMetaDataTest(suite, oldMinor);
                 break;
             }
         }
@@ -321,5 +322,27 @@
             return TestConfiguration.forceJDBC3Embedded(test);
         }
         return test;
+    }
+    
+    // We want to run DatabaseMetaDataTest, but it includes some
+    // features not supported in older versions, so we cannot just
+    // add the DatabaseMetaDataTest.class as is.
+    // Note also, that this does not execute fixture initialCompilationTest.
+    private static void RunDataBaseMetaDataTest (TestSuite suite, int oldMinor)
+    {
+        Method[] methods = DatabaseMetaDataTest.class.getMethods();
+        for (int i = 0; i < methods.length; i++) {
+            Method m = methods[i];
+            if (m.getParameterTypes().length > 0 ||
+                    !m.getReturnType().equals(Void.TYPE)) {
+                continue;
+            }
+            String name = m.getName();
+            if (name.startsWith("test"))
+            {
+                if (!(name.equals("testGetTablesModify") && oldMinor < 1))
+                    suite.addTest(new DatabaseMetaDataTest(name));
+            }
+        }
     }
 }



Mime
View raw message