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
This commit is contained in:
Donald Woods 2009-07-28 19:19:51 +00:00
parent 9658b657c2
commit 7c4cf09bca
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}
}