use of org.apache.jackrabbit.oak.commons.json.JsopBuilder in project jackrabbit-oak by apache.
the class NodeStateJsonUtils method toJson.
public static String toJson(NodeState state, boolean includeHiddenContent) {
JsopWriter json = new JsopBuilder();
copyAsJson(json, state, includeHiddenContent);
return json.toString();
}
use of org.apache.jackrabbit.oak.commons.json.JsopBuilder in project jackrabbit-oak by apache.
the class BundledDocumentDifferTest method diffWithSecondary.
@Test
public void diffWithSecondary() throws Exception {
configureSecondary();
NodeBuilder builder = createContentStructure();
NodeState r1 = merge(store, builder);
NodeState rs1 = DelegatingDocumentNodeState.wrap(secondary.getRoot(), store);
builder = store.getRoot().builder();
childBuilder(builder, "/test/book.jpg/jcr:content").setProperty("foo", "bar");
NodeState r2 = merge(store, builder);
JsopWriter w = new JsopBuilder();
String path = "/test/book.jpg";
assertFalse(differ.diff(adns(rs1, path), adns(r2, path), w));
assertEquals("^\"jcr:content\":{}", w.toString());
}
use of org.apache.jackrabbit.oak.commons.json.JsopBuilder in project jackrabbit-oak by apache.
the class BundledDocumentDifferTest method jsopDiff.
@Test
public void jsopDiff() throws Exception {
JsopWriter w = new JsopBuilder();
differ.diffChildren(of("a", "b"), of("b", "c"), w);
//removed a
//changed b
//added b
assertEquals("-\"a\"^\"b\":{}+\"c\":{}", w.toString());
}
Aggregations