This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1ee57a17d6 OAK-12010: Simplified index management - fix JSON
comparison in tests (#2741)
1ee57a17d6 is described below
commit 1ee57a17d6569e4f1ca3c891d62ee7d20ea582b1
Author: Julian Reschke <[email protected]>
AuthorDate: Fri Feb 13 17:52:18 2026 +0100
OAK-12010: Simplified index management - fix JSON comparison in tests
(#2741)
---
.../oak/plugins/index/diff/JsonNodeUpdaterTest.java | 14 +++++++++-----
1 file changed, 9 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..f31629f077 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
@@ -80,7 +80,7 @@ public class JsonNodeUpdaterTest {
+ " }\n"
+ " }\n"
+ " }\n"
- + "}", json2);
+ + "}", reformatJson(json2));
json = JsonObject.fromJson(
"{\"number\":1," +
@@ -101,7 +101,7 @@ public class JsonNodeUpdaterTest {
+ " \":childOrder\" : [ ]\n"
+ " }\n"
+ " }\n"
- + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+ + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(),
5)));
}
@Test
@@ -132,7 +132,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 +153,7 @@ public class JsonNodeUpdaterTest {
+ " \":childOrder\" : [ ]\n"
+ " }\n"
+ " }\n"
- + "}", JsonUtils.nodeStateToJson(ns.getRoot(), 5));
+ + "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(),
5)));
}
@Test
@@ -220,7 +220,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 json.replace("\r", "");
+ }
}