From a384218429534d2f81e7437ca532d49b3596a60d Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 9 Feb 2007 03:45:17 +0000 Subject: [PATCH] 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 --- .../org/apache/openjpa/conf/TestBadAutoDetachProperty.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java index be119a814..dbdba0b9a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java @@ -18,12 +18,12 @@ package org.apache.openjpa.conf; import java.util.*; import javax.persistence.*; +import javax.persistence.PersistenceException; import junit.framework.*; import org.apache.openjpa.lib.util.ParseException; import org.apache.openjpa.persistence.*; -import org.apache.openjpa.persistence.PersistenceException; public class TestBadAutoDetachProperty extends TestCase { public void testEmptyValue() { @@ -47,6 +47,8 @@ public class TestBadAutoDetachProperty extends TestCase { emf.close(); } catch (PersistenceException e) { Throwable cause = e.getCause(); + while (cause instanceof PersistenceException) + cause = ((PersistenceException) cause).getCause(); if (!(cause instanceof ParseException)) { fail("Should have caught PersistenceException whose cause was " + "a ParseException. " + "Instead the cause was: " @@ -69,6 +71,8 @@ public class TestBadAutoDetachProperty extends TestCase { emf.close(); } catch (PersistenceException e) { Throwable cause = e.getCause(); + while (cause instanceof PersistenceException) + cause = ((PersistenceException) cause).getCause(); if (!(cause instanceof ParseException)) { fail("Should have caught PersistenceException whose cause was " + "a ParseException. " + "Instead the cause was: "