use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class OakTest method commitContextInCommitInfo.
@Test
public void commitContextInCommitInfo() throws Exception {
CommitInfoCapturingStore store = new CommitInfoCapturingStore();
Oak oak = new Oak(store);
ContentRepository repo = oak.with(new OpenSecurityProvider()).createContentRepository();
assertThat(store.infos, is(not(empty())));
for (CommitInfo ci : store.infos) {
assertNotNull(ci.getInfo().get(CommitContext.NAME));
}
((Closeable) repo).close();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class NodeTypeRegistryTest method setUp.
@Before
public void setUp() throws LoginException, NoSuchWorkspaceException {
repository = new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(new TypeEditorProvider()).createContentRepository();
session = repository.login(null, null);
root = session.getLatestRoot();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class CommitContextTest method attributeAddedByCommitHook.
@Test
public void attributeAddedByCommitHook() throws Exception {
repository = new Oak(store).with(new OpenSecurityProvider()).with(observer).with(new CommitHook() {
@Nonnull
@Override
public NodeState processCommit(NodeState before, NodeState after, CommitInfo info) throws CommitFailedException {
CommitContext attrs = (CommitContext) info.getInfo().get(CommitContext.NAME);
assertNotNull(attrs);
attrs.set("foo", "bar");
return after;
}
}).createContentRepository();
session = newSession();
Root root = session.getLatestRoot();
Tree tree = root.getTree("/");
tree.setProperty("a", 1);
root.commit();
assertNotNull(observer.info);
CommitContext attrs = (CommitContext) observer.info.getInfo().get(CommitContext.NAME);
assertNotNull(attrs.get("foo"));
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class SubtreeSolrIndexIT method createRepository.
@Override
protected ContentRepository createRepository() {
try {
DefaultSolrServerProvider solrServerProvider = new DefaultSolrServerProvider();
DefaultSolrConfigurationProvider oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider();
return new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider)).with(new SolrIndexEditorProvider(solrServerProvider, oakSolrConfigurationProvider)).createContentRepository();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class SolrIndexIT method createRepository.
@Override
protected ContentRepository createRepository() {
try {
DefaultSolrServerProvider solrServerProvider = new DefaultSolrServerProvider();
DefaultSolrConfigurationProvider oakSolrConfigurationProvider = new DefaultSolrConfigurationProvider();
return new Oak().with(new InitialContent()).with(new OpenSecurityProvider()).with(new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider)).with(new SolrIndexEditorProvider(solrServerProvider, oakSolrConfigurationProvider)).createContentRepository();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations