Source

Clj-DBCP / src / test / clj / org / bituf / test_clj_dbcp.clj

Diff from to

File src/test/clj/org/bituf/test_clj_dbcp.clj

         drop-table  #(sql/do-commands "DROP TABLE emp")
         retrieve-fn #(sql/with-query-results rows
                       ["SELECT * FROM emp WHERE id=?" 1]
-                      (first rows))]
+                      (first rows))
+        as-int-num #(reduce into {}
+                            (map (fn [[k v]] (if (number? v)
+                                               {k (int v)}
+                                               {k v})) %))]
     (sql/with-connection dbspec
       ;; drop table if pre-exists
       (try (drop-table)
       ;; insert
       (sql/insert-values table (keys orig-record) (vals orig-record))
       ;; retrieve-check
-      (is (= orig-record (retrieve-fn)))
+      (is (= orig-record (as-int-num (retrieve-fn))))
       ;; update
       (sql/update-values table ["id=?" 1] updt-record)
       ;; retrieve-check
-      (is (= updt-record (retrieve-fn)))
+      (is (= updt-record (as-int-num (retrieve-fn))))
       ;; delete
       ;; drop table
       (drop-table))))
 
 
 (defn test-ns-hook []
-  ;(test-odbc)
-  ;(test-derby)
+  (test-odbc)
+  (test-derby)
   (test-h2)
-  ;(test-hsql)
-  ;(test-sqlite)
-  ;(test-firebird)
-  ;(test-mysql)
-  ;(test-cubrid)
-  ;(test-pgsql)
-  ;(smoketest-untested-datasources)
-  ;(test-jndi)
-  ;(test-custom-datasource-parameters)
+  (test-hsql)
+  (test-sqlite)
+  (test-firebird)
+  (test-mysql)
+  (test-cubrid)
+  (test-pgsql)
+  (smoketest-untested-datasources)
+  (test-jndi)
+  (test-custom-datasource-parameters)
   (test-datasource-from-properties-file))