use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class PrivateStoreValidatorProviderTest method setUp.
private void setUp(String... readOnlyPaths) {
configureMountInfoProvider(readOnlyPaths);
repository = new Oak().with(new OpenSecurityProvider()).with(new InitialContent()).with(privateStoreValidatorProvider).createContentRepository();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class CommitContextTest method basicSetup.
@Test
public void basicSetup() throws Exception {
repository = new Oak(store).with(new OpenSecurityProvider()).with(observer).createContentRepository();
session = newSession();
Root root = session.getLatestRoot();
Tree tree = root.getTree("/");
tree.setProperty("a", 1);
root.commit(ImmutableMap.<String, Object>of("foo", "bar"));
assertNotNull(observer.info);
assertTrue(observer.info.getInfo().containsKey("foo"));
assertTrue(observer.info.getInfo().containsKey(CommitContext.NAME));
try {
observer.info.getInfo().put("x", "y");
fail("Info map should be immutable");
} catch (Exception ignore) {
}
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class HybridIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier;
try {
copier = new IndexCopier(executorService, temporaryFolder.getRoot());
} catch (IOException e) {
throw new RuntimeException(e);
}
MountInfoProvider mip = defaultMountInfoProvider();
nrtIndexFactory = new NRTIndexFactory(copier, clock, TimeUnit.MILLISECONDS.toSeconds(refreshDelta), StatisticsProvider.NOOP);
nrtIndexFactory.setAssertAllResourcesClosed(true);
LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier);
IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory);
luceneIndexProvider = new LuceneIndexProvider(tracker);
queue = new DocumentQueue(100, tracker, sameThreadExecutor());
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, null, mip);
editorProvider.setIndexingQueue(queue);
LocalIndexObserver localIndexObserver = new LocalIndexObserver(queue, StatisticsProvider.NOOP);
nodeStore = new MemoryNodeStore();
Oak oak = new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) luceneIndexProvider).with((Observer) luceneIndexProvider).with(localIndexObserver).with(editorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(optionalEditorProvider).with(new NodeCounterEditorProvider()).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class LucenePropertyIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier = createIndexCopier();
editorProvider = new LuceneIndexEditorProvider(copier, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100));
provider = new LuceneIndexProvider(copier);
queryIndexProvider = new ResultCountingIndexProvider(provider);
nodeStore = new MemoryNodeStore();
return new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with(queryIndexProvider).with((Observer) provider).with(editorProvider).with(optionalEditorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).createContentRepository();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class NodeStateCopyUtilsTest method copyToJcrAndHiddenProps.
@Test
public void copyToJcrAndHiddenProps() throws Exception {
repository = new Jcr().with(new OpenSecurityProvider()).createRepository();
Tree srcTree = TreeFactory.createTree(builder);
srcTree.addChild("a").setProperty("foo", "y");
srcTree.addChild("a").setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_OAK_UNSTRUCTURED, Type.NAME);
builder.child(":hidden-node").setProperty("x", "y");
builder.setProperty(":hidden-prop", "y");
Session session = repository.login(null, null);
Node node = session.getRootNode();
Node test = node.addNode("test", NT_OAK_UNSTRUCTURED);
NodeStateCopyUtils.copyToNode(builder.getNodeState(), test);
session.save();
test = session.getNode("/test");
assertEquals("y", test.getProperty("a/foo").getString());
}
Aggregations