use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method builderAcceptsMultipleReadOnlyStores.
@Test
public void builderAcceptsMultipleReadOnlyStores() {
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("readOnly", "/readOnly").readOnlyMount("readOnly2", "/readOnly2").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).addMount("readOnly", new MemoryNodeStore()).addMount("readOnly2", new MemoryNodeStore()).build();
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method builderRejectsTooManyReadWriteStores_oneExtra.
@Test(expected = IllegalArgumentException.class)
public void builderRejectsTooManyReadWriteStores_oneExtra() {
MountInfoProvider mip = Mounts.newBuilder().mount("temp", "/tmp").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).addMount("temp", new MemoryNodeStore()).build();
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider 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.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class PrivateStoreValidatorProviderTest method testValidatorServiceRegistered.
@Test
public void testValidatorServiceRegistered() {
// test service registration, there should be a service for the PrivateStoreValidatorProvider
MountInfoProvider mountInfoProvider = createMountInfoProvider("/content/readonly");
context.registerService(MountInfoProvider.class, mountInfoProvider);
registerValidatorProvider(privateStoreValidatorProvider, true);
EditorProvider validator = context.getService(EditorProvider.class);
assertNotNull("No PrivateStoreValidatorProvider available!", validator);
assertTrue(validator instanceof PrivateStoreValidatorProvider);
assertTrue(((PrivateStoreValidatorProvider) validator).isFailOnDetection());
MockOsgi.deactivate(privateStoreValidatorProvider, context.bundleContext());
assertNull(context.getService(EditorProvider.class));
}
use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.
the class PrivateStoreValidatorProviderTest method configureMountInfoProvider.
/**
* Register a {@link MountInfoProvider} service
* If the given path array is empty, the {@code MountInfoProvider.DEFAULT} will be registered.
*
* @param readOnlyPaths - contains the string paths mounted on a read-only store
*/
private void configureMountInfoProvider(String... readOnlyPaths) {
MountInfoProvider mountInfoProvider = createMountInfoProvider(readOnlyPaths);
privateStoreValidatorProvider.setMountInfoProvider(mountInfoProvider);
privateStoreValidatorProvider.setFailOnDetection(true);
}
Aggregations