use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class AsyncIndexUpdateTest method disableCheckpointCleanup.
@Test
public void disableCheckpointCleanup() throws Exception {
String propertyName = "oak.async.checkpointCleanupIntervalMinutes";
MemoryNodeStore store = new MemoryNodeStore();
IndexEditorProvider provider = new PropertyIndexEditorProvider();
try {
System.setProperty(propertyName, "-1");
final AtomicBoolean cleaned = new AtomicBoolean();
AsyncIndexUpdate async = new AsyncIndexUpdate("async", store, provider) {
@Override
void cleanUpCheckpoints() {
cleaned.set(true);
super.cleanUpCheckpoints();
}
};
async.run();
assertFalse(cleaned.get());
} finally {
System.clearProperty(propertyName);
}
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class AsyncIndexerServiceTest method nonClusterableNodeStoreAndLeaseTimeout.
@Test
public void nonClusterableNodeStoreAndLeaseTimeout() throws Exception {
nodeStore = new MemoryNodeStore();
injectDefaultServices();
Map<String, Object> config = ImmutableMap.<String, Object>of("asyncConfigs", new String[] { "async:5" }, "leaseTimeOutMinutes", "20");
MockOsgi.activate(service, context.bundleContext(), config);
AsyncIndexUpdate indexUpdate = getIndexUpdate("async");
assertEquals(0, indexUpdate.getLeaseTimeOut());
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class SimpleNodeAggregatorTest method testStarNameMoreLevels.
@Test
public void testStarNameMoreLevels() {
NodeState root = new MemoryNodeStore().getRoot();
NodeBuilder builder = root.builder();
NodeBuilder file = builder.child("file");
file.setProperty(JCR_PRIMARYTYPE, NT_FILE);
file.child(JCR_CONTENT);
SimpleNodeAggregator agg = new SimpleNodeAggregator().newRuleWithName(NT_FILE, newArrayList("*", "*/*", "*/*/*", "*/*/*/*"));
String path = "/file/jcr:content";
List<String> actual = newArrayList(agg.getParents(builder.getNodeState(), path));
assertEquals(newArrayList("/file"), actual);
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class SimpleNodeAggregatorTest method testStarNameWrongParentType.
@Test
public void testStarNameWrongParentType() {
NodeState root = new MemoryNodeStore().getRoot();
NodeBuilder builder = root.builder();
NodeBuilder file = builder.child("file");
file.setProperty(JCR_PRIMARYTYPE, NT_FILE + "_");
file.child(JCR_CONTENT);
SimpleNodeAggregator agg = new SimpleNodeAggregator().newRuleWithName(NT_FILE, newArrayList(INCLUDE_ALL));
String path = "/file/jcr:content";
List<String> actual = newArrayList(agg.getParents(builder.getNodeState(), path));
assertTrue(actual.isEmpty());
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method builderRejectsTooManyReadWriteStores_mixed.
@Test(expected = IllegalArgumentException.class)
public void builderRejectsTooManyReadWriteStores_mixed() {
MountInfoProvider mip = Mounts.newBuilder().mount("temp", "/tmp").readOnlyMount("readOnly", "/readOnly").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).addMount("temp", new MemoryNodeStore()).addMount("readOnly", new MemoryNodeStore()).build();
}
Aggregations