db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r489603 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
Date Fri, 22 Dec 2006 10:25:23 GMT
Author: kahatlen
Date: Fri Dec 22 02:25:22 2006
New Revision: 489603

URL: http://svn.apache.org/viewvc?view=rev&rev=489603
Log:
DERBY-2199: Use initCause() in BaseJDBCTestCase.assertSQLState().

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?view=diff&rev=489603&r1=489602&r2=489603
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java Fri
Dec 22 02:25:22 2006
@@ -26,6 +26,7 @@
 import java.io.PrintStream;
 import java.io.Reader;
 import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
 import java.security.PrivilegedActionException;
 import java.net.URL;
 import java.sql.*;
@@ -413,7 +414,13 @@
         } catch (AssertionFailedError e) {
             
             // Save the SQLException
-            // e.initCause(exception);
+            try {
+                Method m = Throwable.class.getMethod(
+                    "initCause", new Class[] { Throwable.class } );
+                m.invoke(e, new Object[] { exception });
+            } catch (Throwable t) {
+                // Some VMs don't support initCause(). It is OK if they fail.
+            }
 
             if (usingDerbyNetClient())
             {



Mime
View raw message