Sybase converts "" to " ", update testcase expectations appropriately.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1006002 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2010-10-08 20:10:15 +00:00
parent 0a17bc1943
commit 733d90cea6
1 changed files with 17 additions and 4 deletions

View File

@ -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();