Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 45891 invoked from network); 3 Sep 2009 16:22:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Sep 2009 16:22:30 -0000 Received: (qmail 12881 invoked by uid 500); 3 Sep 2009 16:22:30 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 12857 invoked by uid 500); 3 Sep 2009 16:22:30 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 12848 invoked by uid 99); 3 Sep 2009 16:22:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 16:22:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 16:22:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 94C4B23888AD; Thu, 3 Sep 2009 16:22:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811012 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.java Date: Thu, 03 Sep 2009 16:22:06 -0000 To: commits@openjpa.apache.org From: fancy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090903162206.94C4B23888AD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fancy Date: Thu Sep 3 16:22:06 2009 New Revision: 811012 URL: http://svn.apache.org/viewvc?rev=811012&view=rev Log: Fix testcase : SQL assertion for Derby only Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/AbstractCriteriaTestCase.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=811012&r1=811011&r2=811012&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 Thu Sep 3 16:22:06 2009 @@ -50,6 +50,7 @@ protected abstract OpenJPAEntityManagerFactorySPI getEntityManagerFactory(); protected abstract EntityManager getEntityManager(); + private DBDictionary dict = null; /** * Create an entity manager factory for persistence unit pu. Put {@link #CLEAR_TABLES} in this list to @@ -84,7 +85,7 @@ void setDictionary() { JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration(); - DBDictionary dict = conf.getDBDictionaryInstance(); + dict = conf.getDBDictionaryInstance(); dict.requiresCastForComparisons = false; dict.requiresCastForMathFunctions = false; } @@ -181,7 +182,10 @@ .get(i)); } } - + + if (!(dict instanceof DerbyDictionary)) + return; + if (expectedSQL != null) { assertEquals("SQL for JPQL and ExpectedSQL for " + jpql + " is different", jSQL.get(0), expectedSQL); @@ -190,9 +194,6 @@ } void executeAndCompareSQL(String jpql, String expectedSQL) { - JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration(); - DBDictionary dict = conf.getDBDictionaryInstance(); - Query jQ = getEntityManager().createQuery(jpql); List jSQL = null; @@ -218,9 +219,6 @@ } void executeAndCompareSQL(Query jQ, String expectedSQL) { - JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration(); - DBDictionary dict = conf.getDBDictionaryInstance(); - List jSQL = null; try { jSQL = executeQueryAndCollectSQL(jQ);