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

reschke pushed a commit to branch OAK-10653
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 785bca36c9f1c62ad44d40a39f92ac680a4db7a4
Author: Julian Reschke <resc...@apache.org>
AuthorDate: Thu Feb 15 14:58:48 2024 +0100

    OAK-10653: BasicDocumentStore: handle DocumentStoreException on ds.create
---
 .../plugins/document/BasicDocumentStoreTest.java   | 23 +++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
old mode 100644
new mode 100755
index 8a416e2de8..b21504df57
--- 
a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
+++ 
b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
@@ -509,15 +509,20 @@ public class BasicDocumentStoreTest extends 
AbstractDocumentStoreTest {
             String pval = generateString(test, true);
             UpdateOp up = new UpdateOp(id, true);
             up.set("foo", pval);
-            boolean success = super.ds.create(Collection.NODES, 
Collections.singletonList(up));
-            if (success) {
-                // check that we really can read it
-                NodeDocument findme = super.ds.find(Collection.NODES, id, 0);
-                assertNotNull("failed to retrieve previously stored document", 
findme);
-                super.ds.remove(Collection.NODES, id);
-                min = test;
-                last = test;
-            } else {
+            try {
+                boolean success = super.ds.create(Collection.NODES, 
Collections.singletonList(up));
+                if (success) {
+                    // check that we really can read it
+                    NodeDocument findme = super.ds.find(Collection.NODES, id, 
0);
+                    assertNotNull("failed to retrieve previously stored 
document", findme);
+                    super.ds.remove(Collection.NODES, id);
+                    min = test;
+                    last = test;
+                } else {
+                    max = test;
+                }
+            } catch (DocumentStoreException ex) {
+                LOG.info("create with property size "+ test + " failed for " + 
super.dsname, ex);
                 max = test;
             }
         }

Reply via email to