db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1074762 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: suites/AllPackages.java tests/jdbc4/Driver40Test.java tests/jdbc4/Driver40UnbootedTest.java tests/jdbcapi/_Suite.java
Date Sat, 26 Feb 2011 00:35:24 GMT
Author: kmarsden
Date: Sat Feb 26 00:35:24 2011
New Revision: 1074762

URL: http://svn.apache.org/viewvc?rev=1074762&view=rev
Log:
DERBY-5069 Since Feb 7,2011 weme 6.2 Junit tests have failed to run completely with Failed
to invoke suite():java.lang.reflect.InvocationTargetException

Prevent Driver tests from running under J2ME which were preventing suites.All from running.
The problem was introduced with revision 1067954 with some additions to DriverTest. It is
not really clear when  JDBC.vmSupportsJSR169() needs to be called in the the individual test
vs the suite calling the test.  In order to get the tests running again, this change moves
the DriverTest check for JSR169 to the suite.  Also added stack traces to the output when
an invocation error occurs to make it easier to track down.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/AllPackages.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40Test.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40UnbootedTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.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=1074762&r1=1074761&r2=1074762&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
Sat Feb 26 00:35:24 2011
@@ -148,6 +148,8 @@ public class AllPackages extends BaseTes
                return new TestSuite("SKIPPED: " + className + " - " +
                        cause.getMessage());
             } else {
+                System.err.println("FAILED to invoke " + className);
+                ite.printStackTrace();
                throw ite;
             }
         } catch (ClassNotFoundException ce) { // Do not add a suite not built.
@@ -164,8 +166,14 @@ public class AllPackages extends BaseTes
      * @throws Exception if the suite() method cannot be called or fails
      */
     private static Test invokeSuite(Class klass) throws Exception {
-        Method suite = klass.getMethod("suite", null);
-        return (Test) suite.invoke(null, null);
+        try {
+            Method suite = klass.getMethod("suite", null);
+            return (Test) suite.invoke(null, null);
+        } catch (Exception e) {
+            System.err.println("Failed to invoke class " + klass.getName());
+            e.printStackTrace();
+            throw e;
+        }
     }
 
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40Test.java?rev=1074762&r1=1074761&r2=1074762&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40Test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40Test.java
Sat Feb 26 00:35:24 2011
@@ -30,6 +30,7 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
 
@@ -70,6 +71,11 @@ public class Driver40Test extends BaseJD
      */
     public static Test suite()
     {
+        if (JDBC.vmSupportsJSR169())
+        {
+            return new TestSuite(
+                "DriverTest40 tests java.sql.Driver, not supported with JSR169");
+        }
         return TestConfiguration.defaultSuite(Driver40Test.class);
     }
    

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40UnbootedTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40UnbootedTest.java?rev=1074762&r1=1074761&r2=1074762&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40UnbootedTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Driver40UnbootedTest.java
Sat Feb 26 00:35:24 2011
@@ -30,6 +30,7 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.TestConfiguration;
 import org.apache.derbyTesting.junit.SpawnedProcess;
 import org.apache.derbyTesting.junit.SecurityManagerSetup;
@@ -75,6 +76,12 @@ public class Driver40UnbootedTest extend
      */
     public static Test suite()
     {
+        if (JDBC.vmSupportsJSR169())
+        {
+            return new TestSuite(
+                "DriverTest tests java.sql.Driver, not supported with JSR169");
+        }
+        
         Test test = TestConfiguration.embeddedSuite(Driver40UnbootedTest.class);
 
         return SecurityManagerSetup.noSecurityManager( test );

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?rev=1074762&r1=1074761&r2=1074762&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
Sat Feb 26 00:35:24 2011
@@ -74,7 +74,10 @@ public class _Suite extends BaseTestCase
 		suite.addTest(ClosedObjectTest.suite());
 		suite.addTest(SetTransactionIsolationTest.suite());
 		suite.addTest(AuthenticationTest.suite());
-		suite.addTest(DriverTest.suite());
+		if (!JDBC.vmSupportsJSR169()) {
+		    // DERBY-5069 Suites.All fails with InvocationTargetException
+		    suite.addTest(DriverTest.suite());
+		}
 		suite.addTest(SURijTest.suite());
 		suite.addTest(NullSQLTextTest.suite());
 		suite.addTest(PrepStmtNullTest.suite());



Mime
View raw message