openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r832117 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria: AbstractCriteriaTestCase.java TestTypeSafeCondExpression.java
Date Mon, 02 Nov 2009 21:43:17 GMT
Author: ppoddar
Date: Mon Nov  2 21:43:17 2009
New Revision: 832117

URL: http://svn.apache.org/viewvc?rev=832117&view=rev
Log:
OPENJPA-1369: Change Order.count column name to save HSQLDB keyword name clash

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java?rev=832117&r1=832116&r2=832117&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java
Mon Nov  2 21:43:17 2009
@@ -36,6 +36,8 @@
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.jdbc.sql.DerbyDictionary;
+import org.apache.openjpa.jdbc.sql.HSQLDictionary;
+import org.apache.openjpa.jdbc.sql.OracleDictionary;
 import org.apache.openjpa.lib.jdbc.AbstractJDBCListener;
 import org.apache.openjpa.lib.jdbc.JDBCEvent;
 import org.apache.openjpa.lib.jdbc.JDBCListener;
@@ -90,10 +92,12 @@
     void setDictionary() {
         JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration();
         dict = conf.getDBDictionaryInstance();
-        if (dict instanceof DerbyDictionary) {
+        if (dict instanceof DerbyDictionary || dict instanceof HSQLDictionary) {
             dict.requiresCastForComparisons = false;
             dict.requiresCastForMathFunctions = false;
-        }
+        } else if (dict instanceof OracleDictionary) {
+            dict.setJoinSyntax("sql92");
+        } 
     }
 
     /**
@@ -218,8 +222,8 @@
             if (!jSQL.get(i).equals(expectedSQL)) {
                 printSQL("SQL for JPQL", jSQL.get(i));
                 printSQL("Expected SQL", expectedSQL);
-                assertEquals(i + "-th Expected SQL and SQL for JPQL: " + jpql + " are different",
expectedSQL, jSQL
-                    .get(i));
+                assertTrue(i + "-th Expected SQL and SQL for JPQL: " + jpql + " are different",

+                    expectedSQL.equalsIgnoreCase(jSQL.get(i)));
             }
         }
     }
@@ -241,7 +245,7 @@
         if (jSql.indexOf("optimize for 1 row") != -1)
             jSql = jSql.substring(0, jSql.indexOf("optimize for 1 row")).trim();
 
-        if (!jSql.equals(expectedSQL)) {
+        if (!jSql.equalsIgnoreCase(expectedSQL)) {
             printSQL("SQL for JPQL", jSql);
             assertEquals(expectedSQL, jSql);
         }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java?rev=832117&r1=832116&r2=832117&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java
Mon Nov  2 21:43:17 2009
@@ -44,6 +44,8 @@
 import javax.persistence.criteria.Root;
 import javax.persistence.criteria.Subquery;
 
+import org.apache.openjpa.persistence.test.DatabasePlatform;
+
 /**
  * Tests type-strict version of Criteria API. The test scenarios are adapted
  * from TestEJBQLCondExpression in



Mime
View raw message