From 733d90cea6e5605f5981e0560eff7d319ca99c42 Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Fri, 8 Oct 2010 20:10:15 +0000 Subject: [PATCH] Sybase converts "" to " ", update testcase expectations appropriately. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1006002 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/event/TestBeforeCommit.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java index fa3f0a0a2..2808f5bc0 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/event/TestBeforeCommit.java @@ -27,6 +27,7 @@ import org.apache.openjpa.event.TransactionListener; 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 AbstractPersistenceTestCase implements Tra 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 AbstractPersistenceTestCase implements Tra 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();