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 dj...@apache.org on 2007/01/11 18:30:30 UTC

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

Author: djd
Date: Thu Jan 11 09:30:29 2007
New Revision: 495301

URL: http://svn.apache.org/viewvc?view=rev&rev=495301
Log:
DERBY-2121 (partial) Minor refactoring of jdbc4.VerifySignatures test to make the
checks in the current MethodTestCase use a static method in the parent class.
This is just to set up for the next step where checking will occur without
a test case per method.

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?view=diff&rev=495301&r1=495300&r2=495301
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java Thu Jan 11 09:30:29 2007
@@ -375,6 +375,20 @@
          * @exception NoSuchMethodException if the method is not found
          */
         public void runTest() throws NoSuchMethodException {
+            checkImplementationMethod(derbyImplementation, ifaceMethod);
+        }   
+    }
+    
+    /**
+     * checks that a class implements a specific method.
+     * @param derbyImplementation The Derby implementation class which is tested
+     * @param ifaceMethod The method that should be implemented.
+     */
+    private static void checkImplementationMethod(
+            Class derbyImplementation, Method ifaceMethod)
+        throws NoSuchMethodException
+    {
+        
             assertFalse("Implementation class is interface",
                         derbyImplementation.isInterface());
 
@@ -413,7 +427,7 @@
          * exception class, or <code>null</code> if no compatible
          * class is found
          */
-        private Class findCompatibleClass(Class exception, Class[] declared)
+        private static Class findCompatibleClass(Class exception, Class[] declared)
         {
             for (Class<?> dec : declared) {
                 if (dec.isAssignableFrom(exception)) {
@@ -422,7 +436,6 @@
             }
             return null;
         }
-    }
 
     /**
      * Test case which checks that all relevant JDBC interfaces are