openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r997888 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
Date Thu, 16 Sep 2010 19:27:54 GMT
Author: mikedd
Date: Thu Sep 16 19:27:53 2010
New Revision: 997888

URL: http://svn.apache.org/viewvc?rev=997888&view=rev
Log:
convert long->string in java - database might not support implicit conversion

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java?rev=997888&r1=997887&r2=997888&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/expressions/TestJPQLScalarExpressions.java
Thu Sep 16 19:27:53 2010
@@ -20,10 +20,15 @@ package org.apache.openjpa.persistence.j
 
 import java.util.List;
 
-import javax.persistence.Query;
 import javax.persistence.EntityManager;
+import javax.persistence.Query;
 
-import org.apache.openjpa.persistence.common.apps.*;
+import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.persistence.OpenJPAEntityManager;
+import org.apache.openjpa.persistence.common.apps.Address;
+import org.apache.openjpa.persistence.common.apps.CompUser;
+import org.apache.openjpa.persistence.common.apps.FemaleUser;
+import org.apache.openjpa.persistence.common.apps.MaleUser;
 import org.apache.openjpa.persistence.common.utils.AbstractTestCase;
 
 public class TestJPQLScalarExpressions extends AbstractTestCase {
@@ -189,7 +194,12 @@ public class TestJPQLScalarExpressions e
         List rs3 = em.createQuery(query3).getResultList();
         Object[] result3 = (Object[]) rs3.get(0);
         assertEquals("the result is not female", "Female", result3[1]);
-        assertEquals("the name is not shannon", "Shannon ", result3[0]);
+        if (((JDBCConfiguration) ((OpenJPAEntityManager) em).getConfiguration()).
+                        getDBDictionaryInstance().trimsTrailingWhitespace) {
+            assertEquals("the name is not shannon", "Shannon", result3[0]);
+        } else {
+            assertEquals("the name is not shannon", "Shannon ", result3[0]);
+        }
         result3 = (Object[]) rs3.get(2);
         assertEquals("the result is not male", "Male", result3[1]);
         assertEquals("the name is not seetha", "Seetha", result3[0]);



Mime
View raw message