use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class ActiveDeletedBlobCollectorMBeanImplTest method setUp.
@Before
public void setUp() {
wb = new OsgiWhiteboard(context.bundleContext());
nodeStore = new MemoryNodeStore();
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class ActiveDeletedBlobCollectorMBeanImplTest method failureToFlagAllIndexFilesShouldAutoResume.
@Test
public void failureToFlagAllIndexFilesShouldAutoResume() {
IndexPathService indexPathService = MockRegistrar.getIndexPathsService(indexPaths);
AsyncIndexInfoService asyncIndexInfoService = MockRegistrar.getAsyncIndexInfoService(newArrayList(new IndexMBeanInfoSupplier("foo-async", () -> STATUS_DONE, () -> 2L)));
NodeStore failingNodeStore = new MemoryNodeStore() {
@Nonnull
@Override
public synchronized NodeState merge(@Nonnull NodeBuilder builder, @Nonnull CommitHook commitHook, @Nonnull CommitInfo info) throws CommitFailedException {
throw new CommitFailedException("TestFail", 1, "We must never merge");
}
};
ActiveDeletedBlobCollectorMBeanImpl bean = new ActiveDeletedBlobCollectorMBeanImpl(ActiveDeletedBlobCollectorFactory.NOOP, wb, failingNodeStore, indexPathService, asyncIndexInfoService, new MemoryBlobStore(), sameThreadExecutor());
bean.clock = clock;
bean.flagActiveDeletionUnsafeForCurrentState();
assertFalse("Failure to update head index files didn't resume marking blobs", bean.isActiveDeletionUnsafe());
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class ExcerptTest method createRepository.
@Override
protected ContentRepository createRepository() {
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider();
LuceneIndexProvider provider = new LuceneIndexProvider();
NodeStore nodeStore = new MemoryNodeStore();
return new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((Observer) provider).with(editorProvider).with((QueryIndexProvider) provider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class CompositeNodeStoreServiceTest method bootstrap.
/**
* Verifies that a minimally-configured <tt>CompositeNodeStore</tt> can be registered successfully
*/
@Test
public void bootstrap() {
MemoryNodeStore mount = new MemoryNodeStore();
MemoryNodeStore global = new MemoryNodeStore();
MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("libs", "/libs", "/apps").build();
ctx.registerService(MountInfoProvider.class, mip);
ctx.registerService(StatisticsProvider.class, StatisticsProvider.NOOP);
ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(global), ImmutableMap.of("role", "composite-global", "registerDescriptors", Boolean.TRUE));
ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(mount), ImmutableMap.of("role", "composite-mount-libs"));
ctx.registerInjectActivateService(new NodeStoreChecksService());
ctx.registerInjectActivateService(new CompositeNodeStoreService());
assertThat("No NodeStore registered", ctx.getService(NodeStore.class), notNullValue());
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class NamespacePrefixNodestoreCheckerTest method prepareRepository.
@Before
public void prepareRepository() throws Exception {
MemoryNodeStore root = new MemoryNodeStore();
mount = new MemoryNodeStore();
NodeBuilder rootBuilder = root.getRoot().builder();
new InitialContent().initialize(rootBuilder);
root.merge(rootBuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
mip = Mounts.newBuilder().readOnlyMount("first", "/first").build();
checker = new NamespacePrefixNodestoreChecker();
context = checker.createContext(root, mip);
}
Aggregations