mirror of https://github.com/apache/openjpa.git
Oracle seems to have changed their error handling.
They now (tested with Oracle 18) behave more like other databases, so we should validate whether one of the described error situations got catched.
This commit is contained in:
parent
c89a94abd8
commit
d6a19dd56a
|
@ -355,6 +355,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
|
||||||
assertNotNull("Failed object was null.", failedObject);
|
assertNotNull("Failed object was null.", failedObject);
|
||||||
if (!isOracle && !isPostgres) {
|
if (!isOracle && !isPostgres) {
|
||||||
assertEquals(expectedFailedObject, failedObject);
|
assertEquals(expectedFailedObject, failedObject);
|
||||||
|
} else if (isOracle) {
|
||||||
|
// since Oracle 18 we see a different behaviour, so test both ways
|
||||||
|
assertTrue(failedObject.equals(expectedFailedObject) || failedObject.equals(expectedFailedObjectOracle) );
|
||||||
} else {
|
} else {
|
||||||
// special case, as Oracle returns all statements in the batch
|
// special case, as Oracle returns all statements in the batch
|
||||||
assertEquals(expectedFailedObjectOracle, failedObject);
|
assertEquals(expectedFailedObjectOracle, failedObject);
|
||||||
|
@ -370,6 +373,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
|
||||||
if (!isOracle && !isPostgres) {
|
if (!isOracle && !isPostgres) {
|
||||||
assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsg + "> but was " +
|
assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsg + "> but was " +
|
||||||
msg, msg.contains(expectedFailureMsg));
|
msg, msg.contains(expectedFailureMsg));
|
||||||
|
} else if (isOracle) {
|
||||||
|
// since Oracle 18 we see a different behaviour, so test both ways
|
||||||
|
assertTrue(msg.contains(expectedFailureMsg) || msg.contains(expectedFailureMsgOracle));
|
||||||
} else {
|
} else {
|
||||||
// special case, as Oracle returns all statements in the batch
|
// special case, as Oracle returns all statements in the batch
|
||||||
assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsgOracle + "> but was " +
|
assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsgOracle + "> but was " +
|
||||||
|
|
Loading…
Reference in New Issue