Search in sources :

Example 26 with MountInfoProvider

use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider 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();
}
Also used : NodeStore(org.apache.jackrabbit.oak.spi.state.NodeStore) MemoryNodeStore(org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore) MemoryNodeStore(org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore) MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider)

Example 27 with MountInfoProvider

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);
}
Also used : MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider) Test(org.junit.Test)

Example 28 with MountInfoProvider

use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.

the class CugUtilTest method testGetSupportedPathsMountsBelowSupportedPath2.

@Test(expected = IllegalStateException.class)
public void testGetSupportedPathsMountsBelowSupportedPath2() {
    MountInfoProvider mip = Mounts.newBuilder().mount("private", "/libs", SUPPORTED_PATH + "/any/path/below").build();
    CugUtil.getSupportedPaths(CUG_CONFIG, mip);
}
Also used : MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider) Test(org.junit.Test)

Example 29 with MountInfoProvider

use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.

the class CugUtilTest method testGetSupportedPathsWithDifferentMounts.

@Test
public void testGetSupportedPathsWithDifferentMounts() {
    Set<String> expected = CUG_CONFIG.getConfigValue(PARAM_CUG_SUPPORTED_PATHS, ImmutableSet.<String>of());
    MountInfoProvider mip = Mounts.newBuilder().mount("private", "/libs", "/apps", "/nonCugPath").build();
    assertNotSame(expected, CugUtil.getSupportedPaths(CUG_CONFIG, mip));
    assertEquals(expected, CugUtil.getSupportedPaths(CUG_CONFIG, mip));
}
Also used : MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider) Test(org.junit.Test)

Example 30 with MountInfoProvider

use of org.apache.jackrabbit.oak.spi.mount.MountInfoProvider in project jackrabbit-oak by apache.

the class SimpleMountInfoProviderTest method mountsPlacedUnder.

@Test
public void mountsPlacedUnder() {
    MountInfoProvider mip = Mounts.newBuilder().mount("first", "/b").mount("second", "/d", "/b/a").mount("third", "/h", "/b/c").build();
    Collection<Mount> mountsContainedBetweenPaths = mip.getMountsPlacedUnder("/b");
    assertEquals(2, mountsContainedBetweenPaths.size());
}
Also used : Mount(org.apache.jackrabbit.oak.spi.mount.Mount) MountInfoProvider(org.apache.jackrabbit.oak.spi.mount.MountInfoProvider) SimpleMountInfoProvider(org.apache.jackrabbit.oak.spi.mount.SimpleMountInfoProvider) Test(org.junit.Test)

Aggregations

MountInfoProvider (org.apache.jackrabbit.oak.spi.mount.MountInfoProvider)47 Test (org.junit.Test)38 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)14 NodeStore (org.apache.jackrabbit.oak.spi.state.NodeStore)9 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)7 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)7 AbstractSecurityTest (org.apache.jackrabbit.oak.AbstractSecurityTest)6 Mount (org.apache.jackrabbit.oak.spi.mount.Mount)6 IndexUpdateProvider (org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider)5 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)5 Mounts.defaultMountInfoProvider (org.apache.jackrabbit.oak.spi.mount.Mounts.defaultMountInfoProvider)5 SimpleMountInfoProvider (org.apache.jackrabbit.oak.spi.mount.SimpleMountInfoProvider)5 IOException (java.io.IOException)4 IndexCopier (org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier)3 IndexTracker (org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker)3 LuceneIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider)3 LuceneIndexProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider)3 DefaultIndexReaderFactory (org.apache.jackrabbit.oak.plugins.index.lucene.reader.DefaultIndexReaderFactory)3 LuceneIndexReaderFactory (org.apache.jackrabbit.oak.plugins.index.lucene.reader.LuceneIndexReaderFactory)3 DefaultNodeStateDiff (org.apache.jackrabbit.oak.spi.state.DefaultNodeStateDiff)3