use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class NodeStateCopierTest method shouldSkipNonMatchingIncludes.
@Test
public void shouldSkipNonMatchingIncludes() throws CommitFailedException, IOException {
final NodeStore source = createNodeStoreWithContent();
final NodeBuilder builder = source.getRoot().builder();
create(builder, "/a", primaryType);
create(builder, "/a/b", primaryType);
create(builder, "/a/b/c", primaryType);
commit(source, builder);
final NodeStore target = createNodeStoreWithContent();
builder().include("/a", "/z").copy(source, target);
expectDifference().strict().verify(source.getRoot(), target.getRoot());
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class NodeStateCopierTest method shouldDeleteExistingNodes.
@Test
public void shouldDeleteExistingNodes() throws CommitFailedException, IOException {
final NodeStore source = createNodeStoreWithContent("/content/foo");
final NodeStore target = createNodeStoreWithContent("/content/bar");
final NodeState before = target.getRoot();
builder().copy(source, target);
final NodeState after = target.getRoot();
expectDifference().strict().childNodeAdded("/content/foo").childNodeChanged("/content").childNodeDeleted("/content/bar").verify(before, after);
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class NodeStateCopierTest method shouldNotDeleteMergedExcludedPaths.
@Test
public void shouldNotDeleteMergedExcludedPaths() throws CommitFailedException, IOException {
final NodeStore source = createNodeStoreWithContent("/content/foo/en", "/jcr:system");
final NodeStore target = createNodeStoreWithContent("/jcr:system/jcr:versionStorage");
final NodeState before = target.getRoot();
builder().merge("/jcr:system").exclude("/jcr:system").copy(source, target);
final NodeState after = target.getRoot();
expectDifference().strict().childNodeAdded("/content", "/content/foo", "/content/foo/en").verify(before, after);
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class CompositeSegmentStoreFixture method createNodeStore.
@Override
public NodeStore createNodeStore() {
try {
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("temp", MOUNT_PATH).build();
NodeStore globalStore = SegmentNodeStoreBuilders.builder(new MemoryStore()).build();
NodeStore tempMount = SegmentNodeStoreBuilders.builder(new MemoryStore()).build();
return new CompositeNodeStore.Builder(mip, globalStore).addMount("temp", tempMount).build();
} catch (IOException e) {
throw new RuntimeException();
}
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class CompositeMemoryStoreFixture method createNodeStore.
@Override
public NodeStore createNodeStore() {
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("temp", MOUNT_PATH).build();
NodeStore globalStore = new MemoryNodeStore();
NodeStore tempMount = new MemoryNodeStore();
return new CompositeNodeStore.Builder(mip, globalStore).addMount("temp", tempMount).build();
}
Aggregations