use of org.apache.jackrabbit.oak.spi.state.NodeBuilder in project jackrabbit-oak by apache.
the class CommitRateLimiterTest method createAfter.
private static NodeState createAfter() {
NodeBuilder builder = EMPTY_NODE.builder();
builder.setChildNode("a");
builder.setProperty("x", 42);
return builder.getNodeState();
}
use of org.apache.jackrabbit.oak.spi.state.NodeBuilder in project jackrabbit-oak by apache.
the class AnnotatingConflictHandler method addConflictMarker.
private static NodeBuilder addConflictMarker(NodeBuilder parent) {
List<String> mixins = newArrayList(parent.getNames(JCR_MIXINTYPES));
if (mixins.add(MIX_REP_MERGE_CONFLICT)) {
parent.setProperty(JCR_MIXINTYPES, mixins, NAMES);
}
NodeBuilder repOurs = parent.child(REP_OURS);
repOurs.setProperty(JCR_PRIMARYTYPE, NodeTypeConstants.NT_REP_UNSTRUCTURED, Type.NAME);
return repOurs;
}
use of org.apache.jackrabbit.oak.spi.state.NodeBuilder in project jackrabbit-oak by apache.
the class CompositeNodeStoreTest method resetOnGlobalStore.
@Test
public void resetOnGlobalStore() {
NodeBuilder builder = store.getRoot().builder();
builder.child("newChild");
store.reset(builder);
assertFalse("Newly added child should no longer be visible after reset", builder.hasChildNode("newChild"));
}
use of org.apache.jackrabbit.oak.spi.state.NodeBuilder in project jackrabbit-oak by apache.
the class CompositeNodeStoreTest method setPropertyOnRootStore.
@Test
public void setPropertyOnRootStore() throws Exception {
NodeBuilder builder = store.getRoot().builder();
builder.setProperty("newProp", "newValue");
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
assertThat("Property must be visible in composite store", store.getRoot().getProperty("newProp").getValue(Type.STRING), equalTo("newValue"));
assertThat("Property must be visible in owning (root) store", globalStore.getRoot().getProperty("newProp").getValue(Type.STRING), equalTo("newValue"));
}
use of org.apache.jackrabbit.oak.spi.state.NodeBuilder in project jackrabbit-oak by apache.
the class CompositeNodeStoreTest method removePropertyFromRootStore.
@Test
public void removePropertyFromRootStore() throws Exception {
NodeBuilder builder = store.getRoot().builder();
builder.removeProperty("prop");
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
assertFalse("Property must be removed from composite store", store.getRoot().hasProperty("prop"));
assertFalse("Property must be removed from owning (root) store", globalStore.getRoot().hasProperty("prop"));
}
Aggregations