You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2026/02/13 15:08:27 UTC

(jackrabbit-oak) branch OAK-12010 created (now b1d815defe)

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

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


      at b1d815defe OAK-12010: Simplified index management - fix JSON comparison in tests

This branch includes the following new commits:

     new b1d815defe OAK-12010: Simplified index management - fix JSON comparison in tests

The 1 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.



(jackrabbit-oak) 01/01: OAK-12010: Simplified index management - fix JSON comparison in tests

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b1d815defeca7a7462376cd00cdeae0e706278e3
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Fri Feb 13 16:08:01 2026 +0100

    OAK-12010: Simplified index management - fix JSON comparison in tests
---
 .../oak/plugins/index/diff/JsonNodeUpdaterTest.java       | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/diff/JsonNodeUpdaterTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/diff/JsonNodeUpdaterTest.java
index 4bcc5db181..d9b2c6dac8 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/diff/JsonNodeUpdaterTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/diff/JsonNodeUpdaterTest.java
@@ -29,6 +29,7 @@ import java.util.TreeSet;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.commons.json.JsonObject;
+import org.apache.jackrabbit.oak.commons.json.JsopBuilder;
 import org.apache.jackrabbit.oak.json.JsonUtils;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore;
 import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
@@ -80,7 +81,7 @@ public class JsonNodeUpdaterTest {
                 + "      }\n"
                 + "    }\n"
                 + "  }\n"
-                + "}", json2);
+                + "}", reformatJson(json2));
 
         json = JsonObject.fromJson(
                 "{\"number\":1," +
@@ -101,7 +102,7 @@ public class JsonNodeUpdaterTest {
                 + "      \":childOrder\" : [ ]\n"
                 + "    }\n"
                 + "  }\n"
-                + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+                + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(), 5)));
     }
 
     @Test
@@ -132,7 +133,7 @@ public class JsonNodeUpdaterTest {
                 + "      \":childOrder\" : [ ]\n"
                 + "    }\n"
                 + "  }\n"
-                + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+                + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(), 5)));
 
         json = JsonObject.fromJson(
                 "{\"number\":1," +
@@ -153,7 +154,7 @@ public class JsonNodeUpdaterTest {
                 + "      \":childOrder\" : [ ]\n"
                 + "    }\n"
                 + "  }\n"
-                + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+                + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(), 5)));
     }
 
     @Test
@@ -220,7 +221,11 @@ public class JsonNodeUpdaterTest {
                 + "    \"strValue\" : \"hello\",\n"
                 + "    \":childOrder\" : [ ]\n"
                 + "  }\n"
-                + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+                + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(), 5)));
     }
 
+    String reformatJson(String json) {
+        // replace \r\n with \n
+        return JsopBuilder.prettyPrint(json);
+    }
 }