use of org.apache.jackrabbit.oak.composite.checks.NodeTypeMountedNodeStoreChecker in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method versionableNode.
@Test(expected = IllegalRepositoryStateException.class)
public void versionableNode() throws CommitFailedException {
MemoryNodeStore root = new MemoryNodeStore();
MemoryNodeStore mount = new MemoryNodeStore();
// create a child node that is versionable
// note that we won't cover all checks here, we are only interested in seeing that at least one check is triggered
NodeBuilder rootBuilder = mount.getRoot().builder();
NodeBuilder childNode = rootBuilder.setChildNode("readOnly").setChildNode("second").setChildNode("third");
childNode.setProperty(JcrConstants.JCR_ISCHECKEDOUT, false);
childNode.setProperty(PropertyStates.createProperty(JcrConstants.JCR_MIXINTYPES, Collections.singletonList(JcrConstants.MIX_VERSIONABLE), Type.NAMES));
mount.merge(rootBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("readOnly", "/readOnly").build();
new CompositeNodeStore.Builder(mip, root).addMount("readOnly", mount).with(new NodeStoreChecksService(mip, Collections.singletonList(new NodeTypeMountedNodeStoreChecker(JcrConstants.MIX_VERSIONABLE, "test error")))).build();
}
Aggregations