From 020b24e00808e78683e7984f7cd7ba3ee02605fb Mon Sep 17 00:00:00 2001 From: "Richard G. Curtis" Date: Tue, 6 Jul 2010 20:03:25 +0000 Subject: [PATCH] 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 --- .../persistence/jdbc/auto/TestAutoIncrement.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java index 839813ff4..cf41d5287 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java @@ -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);