You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mp...@apache.org on 2007/02/09 04:45:18 UTC

svn commit: r505159 - /incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java

Author: mprudhom
Date: Thu Feb  8 19:45:17 2007
New Revision: 505159

URL: http://svn.apache.org/viewvc?view=rev&rev=505159
Log:
Changed assertion to check for javax.persistence.PersistenceException rather than org.apache.openjpa.persistence.PersistenceException, since the API may wrap the PersistenceException.

Modified:
    incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java

Modified: incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java?view=diff&rev=505159&r1=505158&r2=505159
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java (original)
+++ incubator/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/conf/TestBadAutoDetachProperty.java Thu Feb  8 19:45:17 2007
@@ -18,12 +18,12 @@
 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 @@
             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 @@
             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: "