db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1464369 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
Date Thu, 04 Apr 2013 08:58:21 GMT
Author: kahatlen
Date: Thu Apr  4 08:58:21 2013
New Revision: 1464369

URL: http://svn.apache.org/r1464369
Log:
Remove special handling of the abort() method in ClosedObjectTest.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java?rev=1464369&r1=1464368&r2=1464369&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
Thu Apr  4 08:58:21 2013
@@ -118,15 +118,13 @@ public class ClosedObjectTest extends Ba
             method_.invoke(object,
                            getNullArguments(method_.getParameterTypes()));
 
-            // so far, only one method is allowed to be called (and is a NOP)
-            // on a closed JDBC object
-
-            if ( !"public abstract void java.sql.Connection.abort(java.util.concurrent.Executor)
throws java.sql.SQLException".equals( method_.toString() ) )
-            {
-                assertFalse("No exception was thrown for method " + method_,
+            // If we get here, and we expected an exception to be thrown,
+            // report that as a failure.
+            assertFalse("No exception was thrown for method " + method_,
                             decorator_.expectsException(method_));
-            }
         } catch (InvocationTargetException ite) {
+            // An exception was thrown. Check if we expected that an exception
+            // was thrown, and if it was the exception we expected.
             try {
                 throw ite.getCause();
             } catch (SQLException sqle) {
@@ -388,19 +386,16 @@ public class ClosedObjectTest extends Ba
         /**
          * Checks whether a method expects an exception to be thrown
          * when the object is closed. Currently, only
-         * <code>close()</code>, <code>isClosed()</code> and
-         * <code>isValid()</code> don't expect exceptions.
+         * {@code close()}, {@code isClosed()}, {@code isValid()} and
+         * {@code abort()} don't expect exceptions.
          *
          * @param method a method
          * @return <code>true</code> if an exception is expected
          */
         public boolean expectsException(Method method) {
             String name = method.getName();
-            if (name.equals("close") || name.equals("isClosed")
-                    || name.equals("isValid")) {
-                return false;
-            }
-            return true;
+            return !(name.equals("close") || name.equals("isClosed")
+                    || name.equals("isValid") || name.equals("abort"));
         }
 
         /**



Mime
View raw message