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 2008/07/03 11:21:49 UTC

svn commit: r673635 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java

Author: kahatlen
Date: Thu Jul  3 02:21:48 2008
New Revision: 673635

URL: http://svn.apache.org/viewvc?rev=673635&view=rev
Log:
Use helper method to check SQLState.
Removed comment that's no longer valid.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java?rev=673635&r1=673634&r2=673635&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java Thu Jul  3 02:21:48 2008
@@ -163,20 +163,9 @@
             con.close();
             fail("Invalid transaction state exception was not thrown");
         } catch (SQLException sqle) {
-            // The SQL State is incorrect in the embedded client, see
-            // JIRA id DERBY-1168
             String expectedState =
                 SQLStateConstants.INVALID_TRANSACTION_STATE_ACTIVE_SQL_TRANSACTION;
-            
-            if ( ! expectedState.equals(sqle.getSQLState()) )
-            {
-                System.err.println("ERROR: Unexpected SQL State encountered; "
-                    + "got " + sqle.getSQLState() + ", expected " 
-                    + expectedState +
-                    ". Unexpected exception message is " + sqle.getMessage());
-                
-                throw sqle;
-            }
+            assertSQLState(expectedState, sqle);
         }
         assertFalse("Statement should still be open, because " +
                 "Connection.close() failed", stmt.isClosed());