thomasmueller commented on code in PR #2751:
URL: https://github.com/apache/jackrabbit-oak/pull/2751#discussion_r2851362084
##########
oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/diff/JsonNodeUpdaterTest.java:
##########
@@ -142,20 +143,25 @@ public void store() throws CommitFailedException,
IOException {
JsonNodeUpdater.addOrReplace(builder, ns, "/test", "nt:test",
json.toString());
ns.merge(builder, new EmptyHook(), CommitInfo.EMPTY);
assertEquals("{\n"
- + " \"test\" : {\n"
- + " \"number\" : 1,\n"
- + " \"double2\" : 1.0,\n"
- + " \"jcr:primaryType\" : \"nt:test\",\n"
- + " \":childOrder\" : [ \"child2\" ],\n"
- + " \"child2\" : {\n"
- + " \"y\" : 2,\n"
- + " \"jcr:primaryType\" : \"nt:test\",\n"
- + " \":childOrder\" : [ ]\n"
+ + " \"test\": {\n"
+ + " \"number\": 1,\n"
+ + " \"double2\": 1.0,\n"
+ + " \"jcr:primaryType\": \"nt:test\",\n"
+ + " \":childOrder\": [\"child2\"],\n"
+ + " \"child2\": {\n"
+ + " \"y\": 2,\n"
+ + " \"jcr:primaryType\": \"nt:test\",\n"
+ + " \":childOrder\": []\n"
+ " }\n"
+ " }\n"
+ "}", reformatJson(JsonUtils.nodeStateToJson(ns.getRoot(),
5)));
}
+ String reformatJson(String json) {
+ // replace \r\n with \n
+ return JsopBuilder.prettyPrint(json);
+ }
+
Review Comment:
I wrote this independently from Julian Reschke.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]