mirror of https://github.com/apache/openjpa.git
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:
parent
0a17bc1943
commit
733d90cea6
|
@ -27,6 +27,7 @@ import org.apache.openjpa.event.TransactionListener;
|
||||||
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
|
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
|
||||||
import org.apache.openjpa.jdbc.sql.DBDictionary;
|
import org.apache.openjpa.jdbc.sql.DBDictionary;
|
||||||
import org.apache.openjpa.jdbc.sql.OracleDictionary;
|
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.OpenJPAEntityManagerFactorySPI;
|
||||||
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
|
import org.apache.openjpa.persistence.OpenJPAEntityManagerSPI;
|
||||||
import org.apache.openjpa.persistence.test.AbstractPersistenceTestCase;
|
import org.apache.openjpa.persistence.test.AbstractPersistenceTestCase;
|
||||||
|
@ -67,10 +68,16 @@ public class TestBeforeCommit extends AbstractPersistenceTestCase implements Tra
|
||||||
|
|
||||||
tran.begin();
|
tran.begin();
|
||||||
ae = doQuery(em);
|
ae = doQuery(em);
|
||||||
if (dict instanceof OracleDictionary)
|
if (dict instanceof OracleDictionary) {
|
||||||
assertNull(ae.getName());
|
assertNull(ae.getName());
|
||||||
else
|
}
|
||||||
|
else if (dict instanceof SybaseDictionary) {
|
||||||
|
// Sybase converts empty strings to " "
|
||||||
assertEquals(" ", ae.getName());
|
assertEquals(" ", ae.getName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assertEquals("", ae.getName());
|
||||||
|
}
|
||||||
assertEquals(1, ae.getVersion());
|
assertEquals(1, ae.getVersion());
|
||||||
tran.commit();
|
tran.commit();
|
||||||
|
|
||||||
|
@ -98,10 +105,16 @@ public class TestBeforeCommit extends AbstractPersistenceTestCase implements Tra
|
||||||
em.addTransactionListener(this);
|
em.addTransactionListener(this);
|
||||||
EntityTransaction tran = em.getTransaction();
|
EntityTransaction tran = em.getTransaction();
|
||||||
ae = doQuery(em);
|
ae = doQuery(em);
|
||||||
if (dict instanceof OracleDictionary)
|
if (dict instanceof OracleDictionary) {
|
||||||
assertNull(ae.getName());
|
assertNull(ae.getName());
|
||||||
else
|
}
|
||||||
|
else if (dict instanceof SybaseDictionary) {
|
||||||
|
// Sybase converts "" to " "
|
||||||
assertEquals(" ", ae.getName());
|
assertEquals(" ", ae.getName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assertEquals("", ae.getName());
|
||||||
|
}
|
||||||
assertEquals(1, ae.getVersion());
|
assertEquals(1, ae.getVersion());
|
||||||
em.clear();
|
em.clear();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue