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
This commit is contained in:
Albert Lee 2013-08-05 19:15:52 +00:00
parent a0b872f5c2
commit 2ad745381c
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@ package org.apache.openjpa.persistence.jdbc.strategy;
import javax.persistence.EntityManager; 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.jdbc.strategy.MappedEntity.Key;
import org.apache.openjpa.persistence.test.SingleEMFTestCase; import org.apache.openjpa.persistence.test.SingleEMFTestCase;
@ -34,6 +35,10 @@ public class TestHandlerStrategy extends SingleEMFTestCase {
* @see JIRA ticket OPENJPA-2328 for more explanation * @see JIRA ticket OPENJPA-2328 for more explanation
*/ */
public void testIssue_OPENJPA2328() { public void testIssue_OPENJPA2328() {
// Not all databases support GenerationType.IDENTITY column(s)
if (!((JDBCConfiguration) emf.getConfiguration()).getDBDictionaryInstance().supportsAutoAssign) {
return;
}
EntityManager em = emf.createEntityManager(); EntityManager em = emf.createEntityManager();
MapperEntity ae = new MapperEntity(); MapperEntity ae = new MapperEntity();
for (Key key : Key.values()) { for (Key key : Key.values()) {