use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore 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.plugins.memory.MemoryNodeStore 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();
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class MultiplexingLucenePropertyIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier = null;
try {
copier = new IndexCopier(executorService, temporaryFolder.getRoot());
} catch (IOException e) {
throw new RuntimeException(e);
}
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100), null, mip);
LuceneIndexProvider provider = new LuceneIndexProvider(new IndexTracker(new DefaultIndexReaderFactory(mip, copier)));
nodeStore = new MemoryNodeStore();
return new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class NodeStoreBinaryResourceProviderTest method countBinaries.
@Test
public void countBinaries() throws Exception {
NodeBuilder builder = root.builder();
createFileNode(builder, "a", new IdBlob("hello", null), "text/plain");
createFileNode(builder, "b", new IdBlob("hello", "id1"), "text/plain");
createFileNode(builder.child("a2"), "c", new IdBlob("hello", "id2"), "text/foo").setProperty(JcrConstants.JCR_ENCODING, "bar");
NodeStore store = new MemoryNodeStore(builder.getNodeState());
BlobStore blobStore = new MemoryBlobStore();
NodeStoreBinaryResourceProvider extractor = new NodeStoreBinaryResourceProvider(store, blobStore);
assertEquals(2, extractor.getBinaries("/").size());
assertEquals(1, extractor.getBinaries("/a2").size());
BinaryResource bs = extractor.getBinaries("/a2").first().get();
assertEquals("text/foo", bs.getMimeType());
assertEquals("bar", bs.getEncoding());
assertEquals("id2", bs.getBlobId());
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class NodeStoreBinaryResourceProviderTest method csvGenerator.
@Test
public void csvGenerator() throws Exception {
File csv = new File(temporaryFolder.getRoot(), "test.csv");
BlobStore blobStore = new MemoryBlobStore();
NodeBuilder builder = root.builder();
createFileNode(builder, "a", blobOf("foo", blobStore), "text/plain");
createFileNode(builder, "b", blobOf("hello", blobStore), "text/plain");
NodeStore store = new MemoryNodeStore(builder.getNodeState());
NodeStoreBinaryResourceProvider extractor = new NodeStoreBinaryResourceProvider(store, blobStore);
CSVFileGenerator generator = new CSVFileGenerator(csv);
generator.generate(extractor.getBinaries("/"));
CSVFileBinaryResourceProvider csvbrp = new CSVFileBinaryResourceProvider(csv, blobStore);
assertEquals(2, csvbrp.getBinaries("/").size());
csvbrp.close();
}
Aggregations