use of org.apache.jackrabbit.oak.composite.CompositeNodeStore in project jackrabbit-oak by apache.
the class SessionImplCapabilityWithMountInfoProviderTest method prepare.
@Before
public void prepare() throws Exception {
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("ro", "/private").build();
MemoryNodeStore roStore = new MemoryNodeStore();
{
NodeBuilder builder = roStore.getRoot().builder();
builder.child("private").setProperty(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED).setProperty("prop", "value").child("foo").setProperty(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
roStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
MemoryNodeStore globalStore = new MemoryNodeStore();
{
NodeBuilder builder = globalStore.getRoot().builder();
builder.child("foo").setProperty(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED).setProperty("prop", "value").child("bar").setProperty(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
globalStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
CompositeNodeStore store = new CompositeNodeStore.Builder(mip, globalStore).addMount("ro", roStore).build();
Whiteboard whiteboard = new DefaultWhiteboard();
whiteboard.register(MountInfoProvider.class, mip, Collections.emptyMap());
Jcr jcr = new Jcr(store).with(whiteboard);
jcr.createContentRepository();
Repository repository = jcr.createRepository();
adminSession = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
}
Aggregations