Exclude test for Sybase and minor update to SEmfTC

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1005883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2010-10-08 16:28:55 +00:00
parent 5c79f76c69
commit e0a173f17e
2 changed files with 15 additions and 4 deletions

View File

@ -27,6 +27,7 @@ import javax.persistence.RollbackException;
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 extends AbstractNullityTestCase {
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());
}
}
}

View File

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