use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class ReferenceIndexTest method referenceHandlingWithMounts.
@Test
public void referenceHandlingWithMounts() throws Exception {
NodeState root = INITIAL_CONTENT;
NodeBuilder builder = root.builder();
NodeState before = builder.getNodeState();
builder.child("a").child("x").setProperty(createProperty("foo", "u1", Type.REFERENCE));
builder.child("b").setProperty(createProperty("foo", "u1", Type.REFERENCE));
builder.child("c").setProperty(createProperty("foo", "u1", Type.WEAKREFERENCE));
builder.child("d").setProperty(createProperty("foo", "u2", Type.WEAKREFERENCE));
builder.child("a").child("y").setProperty(createProperty("foo", "u1", Type.WEAKREFERENCE));
NodeState after = builder.getNodeState();
MountInfoProvider mip = Mounts.newBuilder().mount("foo", "/a").build();
EditorHook hook = new EditorHook(new IndexUpdateProvider(new ReferenceEditorProvider().with(mip)));
ReferenceIndex referenceIndex = new ReferenceIndex(mip);
NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY);
FilterImpl f = createFilter(indexed, NT_BASE);
f.restrictProperty("*", Operator.EQUAL, newReference("u1"), PropertyType.REFERENCE);
// System.out.println(NodeStateUtils.toString(NodeStateUtils.getNode(indexed, "/oak:index/reference")));
assertFilter(f, referenceIndex, indexed, of("/a/x", "/b"));
FilterImpl f2 = createFilter(indexed, NT_BASE);
f2.restrictProperty("*", Operator.EQUAL, newReference("u1"), PropertyType.WEAKREFERENCE);
assertFilter(f2, referenceIndex, indexed, of("/c", "/a/y"));
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class PrivateStoreValidatorProviderTest method testValidatorServiceNotRegistered.
@Test
public void testValidatorServiceNotRegistered() {
// test service registration, for default mount there should be no service for the validator provider
MountInfoProvider mountInfoProvider = createMountInfoProvider();
context.registerService(MountInfoProvider.class, mountInfoProvider);
registerValidatorProvider(privateStoreValidatorProvider, true);
EditorProvider validator = context.getService(EditorProvider.class);
assertNull("No PrivateStoreValidatorProvider should be registered for default mounts!", validator);
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method mismatchBetweenMountNameAndStoreName.
@Test(expected = NullPointerException.class)
public void mismatchBetweenMountNameAndStoreName() {
MountInfoProvider mip = Mounts.newBuilder().mount("temp", "/tmp").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).addMount("not-temp", new MemoryNodeStore()).build();
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method mismatchBetweenMountsAndStoresIsRejected.
@Test(expected = IllegalArgumentException.class)
public void mismatchBetweenMountsAndStoresIsRejected() {
MountInfoProvider mip = Mounts.newBuilder().mount("temp", "/tmp").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).build();
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class CugUtilTest method testGetSupportedPathsMountsAboveSupportedPath.
@Test(expected = IllegalStateException.class)
public void testGetSupportedPathsMountsAboveSupportedPath() {
MountInfoProvider mip = Mounts.newBuilder().mount("private", PathUtils.ROOT_PATH).build();
CugUtil.getSupportedPaths(CUG_CONFIG, mip);
}
Aggregations