From 2ad745381c2c60217657d1115fd9cb0d9f3a54eb Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Mon, 5 Aug 2013 19:15:52 +0000 Subject: [PATCH] OPENJPA-2378 - Fix test case to run test only if supportsAutoAssign is enabled. Contributed by Di Lau git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1510667 13f79535-47bb-0310-9956-ffa450edef68 --- .../persistence/jdbc/strategy/TestHandlerStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestHandlerStrategy.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestHandlerStrategy.java index d6da027b6..eb38ae5fd 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestHandlerStrategy.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/strategy/TestHandlerStrategy.java @@ -17,6 +17,7 @@ package org.apache.openjpa.persistence.jdbc.strategy; import javax.persistence.EntityManager; +import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.persistence.jdbc.strategy.MappedEntity.Key; import org.apache.openjpa.persistence.test.SingleEMFTestCase; @@ -34,6 +35,10 @@ public class TestHandlerStrategy extends SingleEMFTestCase { * @see JIRA ticket OPENJPA-2328 for more explanation */ public void testIssue_OPENJPA2328() { + // Not all databases support GenerationType.IDENTITY column(s) + if (!((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance().supportsAutoAssign) { + return; + } EntityManager em = emf.createEntityManager(); MapperEntity ae = new MapperEntity(); for (Key key : Key.values()) {