From 7c4cf09bcaca706d2de542e7da50b2c37831d44e Mon Sep 17 00:00:00 2001 From: Donald Woods Date: Tue, 28 Jul 2009 19:19:51 +0000 Subject: [PATCH] OPENJPA-1076 Handle changes in geronimo-jpa_2.0_spec Rev798659 to not wrapper all exceptions as PersistenceExceptions and allow the spec to call other providers it discovers. We'll keep the createEMF behavior of returning exceptions sometimes instead of null, until we see if the JPA2 TCK forces the issue.... git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@798662 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/conf/TestSpecificationConfiguration.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestSpecificationConfiguration.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestSpecificationConfiguration.java index 36d4972fa..f96e986cb 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestSpecificationConfiguration.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestSpecificationConfiguration.java @@ -57,15 +57,19 @@ public class TestSpecificationConfiguration extends SingleEMFTestCase { assertEquals(1, spec.getVersion()); } + /* + * Slight change for 2.0, in that the geronimo spec does not rethrow + * all exceptions wrapped as a PersistenceException + */ public void testHigherVersionCanNotBeSet() { try { super.setUp("openjpa.Specification", "jpa 3.0", "openjpa.Log", "DefaultLevel=WARN"); fail("Expected to fail with higher Spec version"); - } catch (PersistenceException ex) { + } catch (IllegalArgumentException ex) { // good emf.getConfiguration().getLog("Tests").trace( - "Caught expected PersistenceException = " + ex); + "Caught expected IllegalArgumentException = " + ex); } }