mirror of https://github.com/apache/openjpa.git
Changed assertion to check for javax.persistence.PersistenceException rather than org.apache.openjpa.persistence.PersistenceException, since the API may wrap the PersistenceException.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@505159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7ea424bf0b
commit
a384218429
|
@ -18,12 +18,12 @@ package org.apache.openjpa.conf;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
import javax.persistence.PersistenceException;
|
||||||
|
|
||||||
import junit.framework.*;
|
import junit.framework.*;
|
||||||
|
|
||||||
import org.apache.openjpa.lib.util.ParseException;
|
import org.apache.openjpa.lib.util.ParseException;
|
||||||
import org.apache.openjpa.persistence.*;
|
import org.apache.openjpa.persistence.*;
|
||||||
import org.apache.openjpa.persistence.PersistenceException;
|
|
||||||
|
|
||||||
public class TestBadAutoDetachProperty extends TestCase {
|
public class TestBadAutoDetachProperty extends TestCase {
|
||||||
public void testEmptyValue() {
|
public void testEmptyValue() {
|
||||||
|
@ -47,6 +47,8 @@ public class TestBadAutoDetachProperty extends TestCase {
|
||||||
emf.close();
|
emf.close();
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
|
while (cause instanceof PersistenceException)
|
||||||
|
cause = ((PersistenceException) cause).getCause();
|
||||||
if (!(cause instanceof ParseException)) {
|
if (!(cause instanceof ParseException)) {
|
||||||
fail("Should have caught PersistenceException whose cause was "
|
fail("Should have caught PersistenceException whose cause was "
|
||||||
+ "a ParseException. " + "Instead the cause was: "
|
+ "a ParseException. " + "Instead the cause was: "
|
||||||
|
@ -69,6 +71,8 @@ public class TestBadAutoDetachProperty extends TestCase {
|
||||||
emf.close();
|
emf.close();
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
|
while (cause instanceof PersistenceException)
|
||||||
|
cause = ((PersistenceException) cause).getCause();
|
||||||
if (!(cause instanceof ParseException)) {
|
if (!(cause instanceof ParseException)) {
|
||||||
fail("Should have caught PersistenceException whose cause was "
|
fail("Should have caught PersistenceException whose cause was "
|
||||||
+ "a ParseException. " + "Instead the cause was: "
|
+ "a ParseException. " + "Instead the cause was: "
|
||||||
|
|
Loading…
Reference in New Issue