You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by cu...@apache.org on 2010/07/06 22:03:25 UTC
svn commit: r961000 -
/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java
Author: curtisr7
Date: Tue Jul 6 20:03:25 2010
New Revision: 961000
URL: http://svn.apache.org/viewvc?rev=961000&view=rev
Log:
Update TestAutoIncrement to not run on Oracle and SQLServer.
Modified:
openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java
Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java?rev=961000&r1=960999&r2=961000&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/auto/TestAutoIncrement.java Tue Jul 6 20:03:25 2010
@@ -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);