use of org.apache.jackrabbit.oak.InitialContent in project jackrabbit-oak by apache.
the class UniquePropertyTest method testUniqueness.
@Test
public void testUniqueness() throws Exception {
Root root = new Oak().with(new OpenSecurityProvider()).with(new PropertyIndexEditorProvider()).with(new InitialContent()).createRoot();
NodeUtil node = new NodeUtil(root.getTree("/"));
String uuid = UUID.randomUUID().toString();
node.setString(JcrConstants.JCR_UUID, uuid);
root.commit();
NodeUtil child = new NodeUtil(root.getTree("/")).addChild("another", "rep:User");
child.setString(JcrConstants.JCR_UUID, uuid);
try {
root.commit();
fail("Duplicate jcr:uuid should be detected.");
} catch (CommitFailedException e) {
// expected
}
}
use of org.apache.jackrabbit.oak.InitialContent in project jackrabbit-oak by apache.
the class PropertyIndexStatsTest method prepareStore.
private void prepareStore() throws CommitFailedException {
activateMBean();
NodeState root = store.getRoot();
NodeBuilder builder = root.builder();
new InitialContent().initialize(builder);
store.merge(builder, HOOK, CommitInfo.EMPTY);
}
use of org.apache.jackrabbit.oak.InitialContent in project jackrabbit-oak by apache.
the class PropertyIndexInfoProviderTest method setUp.
@Before
public void setUp() throws CommitFailedException {
NodeBuilder builder = store.getRoot().builder();
new InitialContent().initialize(builder);
store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
use of org.apache.jackrabbit.oak.InitialContent 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.InitialContent 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);
}
}
Aggregations