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/07/19 12:34:00 UTC

svn commit: r423427 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java

Author: kahatlen
Date: Wed Jul 19 03:34:00 2006
New Revision: 423427

URL: http://svn.apache.org/viewvc?rev=423427&view=rev
Log:
DERBY-1534: Add BaseJDBCTestCase.assertSQLState() overload with no
message parameter

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java?rev=423427&r1=423426&r2=423427&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java Wed Jul 19 03:34:00 2006
@@ -213,8 +213,6 @@
      * @param message message to print on failure.
      * @param expected the expected SQLState.
      * @param exception the exception to check the SQLState of.
-     *
-     * @throws IllegalArgumentException if exception is <code>null</code>.
      */
     public static void assertSQLState(String message, 
                                       String expected, 
@@ -235,6 +233,17 @@
                 expected.length() == 5);
         
         assertEquals(message, expected, state);
+    }
+
+    /**
+     * Assert that SQLState is as expected.
+     * The expected SQLState is truncated to five characters if required.
+     *
+     * @param expected the expected SQLState.
+     * @param exception the exception to check the SQLState of.
+     */
+    public static void assertSQLState(String expected, SQLException exception) {
+        assertSQLState("Unexpected SQL state.", expected, exception);
     }
     
     /**