openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r645610 - /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java
Date Mon, 07 Apr 2008 16:52:32 GMT
Author: awhite
Date: Mon Apr  7 09:52:31 2008
New Revision: 645610

URL: http://svn.apache.org/viewvc?rev=645610&view=rev
Log:
Be a little more flexible on the exceptions thrown when persisting instances
with auto-generated keys already assigned values.


Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java?rev=645610&r1=645609&r2=645610&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/generationtype/TestGeneratedValues.java
Mon Apr  7 09:52:31 2008
@@ -19,6 +19,7 @@
 package org.apache.openjpa.persistence.generationtype;
 
 import javax.persistence.EntityManager;
+import javax.persistence.EntityExistsException;
 
 import org.apache.openjpa.persistence.InvalidStateException;
 import org.apache.openjpa.persistence.test.SingleEMFTestCase;
@@ -59,7 +60,10 @@
         } catch (InvalidStateException ise) {
             // expected result
             return;
-        } 
+        }  catch (EntityExistsException eee) {
+            // also ok
+            return;
+        }
         
         // should not get here...
         fail();
@@ -78,7 +82,10 @@
         } catch (InvalidStateException ise) {
             // expected result
             return;
-        } 
+        }  catch (EntityExistsException eee) {
+            // also ok
+            return;
+        }
         
         // should not get here...
         fail();



Mime
View raw message