openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r796037 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/CriteriaTest.java
Date Mon, 20 Jul 2009 21:57:09 GMT
Author: faywang
Date: Mon Jul 20 21:57:08 2009
New Revision: 796037

URL: http://svn.apache.org/viewvc?rev=796037&view=rev
Log:
OPENJPA-1143: fix test case as the expectedSQL is generated from Derby database and the comparison
between push-down sql and expectedSQL is only valid for Derby database.

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

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/CriteriaTest.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/CriteriaTest.java?rev=796037&r1=796036&r2=796037&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/CriteriaTest.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/CriteriaTest.java
Mon Jul 20 21:57:08 2009
@@ -38,6 +38,7 @@
 
 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.lib.jdbc.AbstractJDBCListener;
 import org.apache.openjpa.lib.jdbc.JDBCEvent;
 import org.apache.openjpa.lib.jdbc.JDBCListener;
@@ -237,6 +238,11 @@
     }
     
     void executeAndCompareSQL(String jpql, String expectedSQL) {
+        JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
+        DBDictionary dict = conf.getDBDictionaryInstance();
+        if (!(dict instanceof DerbyDictionary))
+            return;
+
         Query jQ = em.createQuery(jpql);
 
         List<String> jSQL = null;
@@ -261,6 +267,11 @@
     }
     
     void executeAndCompareSQL(Query jQ, String expectedSQL) {
+        JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
+        DBDictionary dict = conf.getDBDictionaryInstance();
+        if (!(dict instanceof DerbyDictionary))
+            return;
+
         List<String> jSQL = null;
         try {
             jSQL = executeQueryAndCollectSQL(jQ);



Mime
View raw message