Be a little more flexible on the exceptions thrown when persisting instances

with auto-generated keys already assigned values.



git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@645610 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2008-04-07 16:52:31 +00:00
parent 9c19356c7c
commit ea8b942364
1 changed files with 9 additions and 2 deletions

View File

@ -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 @@ public class TestGeneratedValues extends SingleEMFTestCase {
} catch (InvalidStateException ise) {
// expected result
return;
}
} catch (EntityExistsException eee) {
// also ok
return;
}
// should not get here...
fail();
@ -78,7 +82,10 @@ public class TestGeneratedValues extends SingleEMFTestCase {
} catch (InvalidStateException ise) {
// expected result
return;
}
} catch (EntityExistsException eee) {
// also ok
return;
}
// should not get here...
fail();