openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r1005883 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence: nullity/TestBasicFieldNullity.java test/SingleEMFTestCase.java
Date Fri, 08 Oct 2010 16:28:56 GMT
Author: mikedd
Date: Fri Oct  8 16:28:55 2010
New Revision: 1005883

URL: http://svn.apache.org/viewvc?rev=1005883&view=rev
Log:
Exclude test for Sybase and minor update to SEmfTC

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/nullity/TestBasicFieldNullity.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/nullity/TestBasicFieldNullity.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/nullity/TestBasicFieldNullity.java?rev=1005883&r1=1005882&r2=1005883&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/nullity/TestBasicFieldNullity.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/nullity/TestBasicFieldNullity.java
Fri Oct  8 16:28:55 2010
@@ -27,6 +27,7 @@ import javax.persistence.RollbackExcepti
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.jdbc.sql.DBDictionary;
 import org.apache.openjpa.jdbc.sql.OracleDictionary;
+import org.apache.openjpa.jdbc.sql.SybaseDictionary;
 import org.apache.openjpa.persistence.InvalidStateException;
 import org.apache.openjpa.persistence.OpenJPAPersistence;
 
@@ -167,10 +168,16 @@ public class TestBasicFieldNullity exten
         List<NullValues> result = query.getResultList();
         assertFalse(result.isEmpty());
         for (NullValues n : result) {
-            if (dict instanceof OracleDictionary)
+            if (dict instanceof OracleDictionary) {
                 assertNull(n.getUniqueNullable());
-            else
-                assertEquals(EMPTY_STRING, n.getUniqueNullable()); 
+            }
+            else if (dict instanceof SybaseDictionary) { 
+                // Sybase converts empty strings to "" 
+                assertEquals(" ", n.getUniqueNullable());
+            }
+            else {
+                assertEquals(EMPTY_STRING, n.getUniqueNullable());
+            }
         }
     }
     

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java?rev=1005883&r1=1005882&r2=1005883&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/SingleEMFTestCase.java
Fri Oct  8 16:28:55 2010
@@ -203,7 +203,7 @@ public abstract class SingleEMFTestCase
     }
     
     protected String getForUpdateClause() {
-        DBDictionary dict = ((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance();
+        DBDictionary dict = getDBDictionary();
         if (dict.forUpdateClause != null) {
             return dict.forUpdateClause;
         }
@@ -212,5 +212,9 @@ public abstract class SingleEMFTestCase
         }
         return "";
     }
+    
+    protected DBDictionary getDBDictionary() { 
+        return  ((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance();
+    }
 }
 



Mime
View raw message