db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r633658 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java
Date Tue, 04 Mar 2008 21:38:11 GMT
Author: djd
Date: Tue Mar  4 13:38:09 2008
New Revision: 633658

URL: http://svn.apache.org/viewvc?rev=633658&view=rev
Log:
DERBY-3385 Add the management suite to suites.All (through AllPackages).
Change the way the JDK 5 & 6 suites are added by reflection to always attempt to add them
and if they fail to add due to a LinkageError leave information that they were skipped and
why. JDK 5 & 6 tests will fail to add in JDK 1.4 and J2ME due to class version issues.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java?rev=633658&r1=633657&r2=633658&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java
Tue Mar  4 13:38:09 2008
@@ -62,12 +62,14 @@
         // Suites that are compiled using Java SE 6 target need to
         // be added this way, otherwise creating the suite
         // will throw an invalid class version error
-        if (JDBC.vmSupportsJDBC4())
-        {
-            suite.addTest(
+        suite.addTest(
                     addSuiteByReflection(
                             "org.apache.derbyTesting.functionTests.tests.jdbc4._Suite"));
-        }
+        
+        // JMX management tests are compiled and require JDK 1.5
+        suite.addTest(
+                addSuiteByReflection(
+                        "org.apache.derbyTesting.functionTests.tests.management._Suite"));
 
         // Adding JUnit unit tests here to avoid creating a new JUnit
         // harness above the functionTests and unitTests
@@ -89,11 +91,16 @@
      */
     private static Test addSuiteByReflection(String className) throws Exception
     {
-        Class clz = Class.forName(className);
-        
-        Method sm = clz.getMethod("suite", null);
-              
-        return (Test) sm.invoke(null, null);
+        try {
+            Class clz = Class.forName(className);
+            
+            Method sm = clz.getMethod("suite", null);
+                  
+            return (Test) sm.invoke(null, null);
+        } catch (LinkageError  e) {
+            return new TestSuite("SKIPPED: " + className + " - " +
+                    e.getMessage());
+        }
     }
 
 }



Mime
View raw message