db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r423427 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestCase.java
Date Wed, 19 Jul 2006 10:34:00 GMT
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);
     }
     
     /**



Mime
View raw message