Update TestAutoIncrement to not run on Oracle and SQLServer.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@961000 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Richard G. Curtis 2010-07-06 20:03:25 +00:00
parent 5668a18ec0
commit 020b24e008
1 changed files with 14 additions and 1 deletions

View File

@ -19,18 +19,31 @@
package org.apache.openjpa.persistence.jdbc.auto;
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.SQLServerDictionary;
import org.apache.openjpa.persistence.test.SingleEMTestCase;
public class TestAutoIncrement extends SingleEMTestCase {
boolean disabled = false;
public void setUp() {
super.setUp(DROP_TABLES, AutoIncrementEntity.class);
if (!((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance().supportsAutoAssign) {
DBDictionary dic = ((JDBCConfiguration)emf.getConfiguration()).getDBDictionaryInstance();
if (!dic.supportsAutoAssign) {
disabled = true;
return;
}
if (dic instanceof SQLServerDictionary || dic instanceof OracleDictionary) {
disabled = true;
return;
}
createZeroIdEntity();
}
public void test() {
if (disabled) {
return;
}
em.getTransaction().begin();
AutoIncrementEntity e1 = em.find(AutoIncrementEntity.class, 0);
assertNotNull(e1);