db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r512517 [3/3] - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbcapi/ParameterMappingTest.java functionTests/tests/jdbcapi/_Suite.java junit/BaseJDBCTestCase.java
Date Wed, 28 Feb 2007 00:17:32 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java?view=diff&rev=512517&r1=512516&r2=512517
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/_Suite.java
Tue Feb 27 16:17:31 2007
@@ -61,6 +61,7 @@
 		suite.addTest(CharacterStreamsTest.suite());
 		suite.addTest(BatchUpdateTest.suite());
 		suite.addTest(StreamTest.suite());
+                suite.addTest(ParameterMappingTest.suite());
 		suite.addTest(DboPowersTest.suite());
         
         // Old harness .java tests that run using the HarnessJavaTest

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?view=diff&rev=512517&r1=512516&r2=512517
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java Tue
Feb 27 16:17:31 2007
@@ -853,6 +853,33 @@
         }
     }
 
+    /**
+     * Compares two JDBC types to see if they are equivalent.
+     * DECIMAL and NUMERIC and DOUBLE and FLOAT are considered
+     * equivalent.
+     * @param expectedType Expected jdbctype from java.sql.Types
+     * @param type         Actual type from metadata
+     */
+    public static void assertEquivalentDataType(int expectedType, int type)
+    {
+     if (expectedType == type)
+         return;
+     if (expectedType == java.sql.Types.DECIMAL && 
+                 type == java.sql.Types.NUMERIC)
+         return;
+     if (expectedType == java.sql.Types.NUMERIC && 
+             type == java.sql.Types.DECIMAL)
+         return;
+     if (expectedType == java.sql.Types.DOUBLE && 
+                 type == java.sql.Types.FLOAT)
+         return;
+     if (expectedType == java.sql.Types.FLOAT && 
+             type == java.sql.Types.DOUBLE)
+     return;
+     fail("types:" + expectedType + " and " + type + " are not equivalent");
+     
+    }
+    
 } // End class BaseJDBCTestCase
 
 



Mime
View raw message