You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2006/12/22 11:25:23 UTC

svn commit: r489603 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

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())
             {