[openjpa] branch master updated (59a8586 -> d6a19dd)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[openjpa] branch master updated (59a8586 -> d6a19dd)

struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


    from 59a8586  OPENJPA-2865 use java.time handling from JDBC driver
     new c89a94a  reduce loop count because that test takes 2 minutes
     new d6a19dd  Oracle seems to have changed their error handling.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../persistence/batch/exception/TestBatchLimitException.java        | 6 ++++++
 .../persistence/optlockex/timestamp/TestTimestampOptLockEx.java     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
Reply | Threaded
Open this post in threaded view
|

[openjpa] 01/02: reduce loop count because that test takes 2 minutes

struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit c89a94abd8d31eb5571a51764e97d7061ea7ea47
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat Apr 10 11:10:51 2021 +0200

    reduce loop count because that test takes 2 minutes
---
 .../openjpa/persistence/optlockex/timestamp/TestTimestampOptLockEx.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/optlockex/timestamp/TestTimestampOptLockEx.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/optlockex/timestamp/TestTimestampOptLockEx.java
index 1f60524..422da7d 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/optlockex/timestamp/TestTimestampOptLockEx.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/optlockex/timestamp/TestTimestampOptLockEx.java
@@ -59,7 +59,7 @@ public class TestTimestampOptLockEx extends SingleEMFTestCase {
         //This loop is necessary since we need a timestamp which has been rounded up
         //by the database, or by OpenJPA such that the in-memory version of the Timestamp
         //varies from that which is in the database.
-        for (int i = 0; i < 50000; i++) {
+        for (int i = 0; i < 5000; i++) {
             EntityManager em = emf.createEntityManager();
             EntityTransaction tx = em.getTransaction();
 
Reply | Threaded
Open this post in threaded view
|

[openjpa] 02/02: Oracle seems to have changed their error handling.

struberg
In reply to this post by struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit d6a19dd56a020d2991129584dcf221262bff28d1
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat Apr 10 11:11:21 2021 +0200

    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.
---
 .../persistence/batch/exception/TestBatchLimitException.java        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
index 26a2358..b129ac3 100644
--- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
+++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/batch/exception/TestBatchLimitException.java
@@ -355,6 +355,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
             assertNotNull("Failed object was null.", failedObject);
             if (!isOracle && !isPostgres) {
                 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 {
                 // special case, as Oracle returns all statements in the batch
                 assertEquals(expectedFailedObjectOracle, failedObject);
@@ -370,6 +373,9 @@ public class TestBatchLimitException extends AbstractPersistenceTestCase {
         if (!isOracle && !isPostgres) {
             assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsg + "> but was " +
                 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 {
             // special case, as Oracle returns all statements in the batch
             assertTrue("Did not see expected text in message. Expected <" + expectedFailureMsgOracle + "> but was " +