openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r1006002 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java
Date Fri, 08 Oct 2010 20:10:15 GMT
Author: mikedd
Date: Fri Oct  8 20:10:15 2010
New Revision: 1006002

URL: http://svn.apache.org/viewvc?rev=1006002&view=rev
Log:
Sybase converts "" to " ", update testcase expectations appropriately. 

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java?rev=1006002&r1=1006001&r2=1006002&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java
Fri Oct  8 20:10:15 2010
@@ -27,6 +27,7 @@ import org.apache.openjpa.event.Transact
 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.OpenJPAEntityManagerFactorySPI;
 import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
 import org.apache.openjpa.persistence.test.AbstractPersistenceTestCase;
@@ -67,10 +68,16 @@ public class TestBeforeCommit extends Ab
 
         tran.begin();
         ae = doQuery(em);
-        if (dict instanceof OracleDictionary)
+        if (dict instanceof OracleDictionary) {
             assertNull(ae.getName());
-        else
+        }
+        else if (dict instanceof SybaseDictionary) {
+            // Sybase converts empty strings to " " 
+            assertEquals(" ", ae.getName()); 
+        }
+        else {
             assertEquals("", ae.getName());
+        }
         assertEquals(1, ae.getVersion());
         tran.commit();
 
@@ -98,10 +105,16 @@ public class TestBeforeCommit extends Ab
         em.addTransactionListener(this);
         EntityTransaction tran = em.getTransaction();
         ae = doQuery(em);
-        if (dict instanceof OracleDictionary)
+        if (dict instanceof OracleDictionary) {
             assertNull(ae.getName());
-        else 
+        }
+        else if (dict instanceof SybaseDictionary) {
+            // Sybase converts "" to " "
+            assertEquals(" ", ae.getName()); 
+        }
+        else { 
             assertEquals("", ae.getName());
+        }
         assertEquals(1, ae.getVersion());
         em.clear();
 



Mime
View raw message