use of org.apache.jackrabbit.oak.InitialContent in project jackrabbit-oak by apache.
the class IdentifierManagerTest method setUp.
@Before
public void setUp() throws CommitFailedException {
root = new Oak().with(new OpenSecurityProvider()).with(new InitialContent()).createContentSession().getLatestRoot();
Tree tree = root.getTree("/");
Tree x = tree.addChild("x");
Tree y = tree.addChild("y");
y.setProperty(JcrConstants.JCR_UUID, UUID_Y);
Tree z = tree.addChild("z");
x.addChild("x1");
y.addChild("y1");
z.addChild("z1").setProperty(JcrConstants.JCR_UUID, UUID_Z1);
root.commit();
identifierManager = new IdentifierManager(root);
}
use of org.apache.jackrabbit.oak.InitialContent in project jackrabbit-oak by apache.
the class NodeCounterIndexTest method createRepository.
protected ContentRepository createRepository() {
nodeStore = new MemoryNodeStore();
Oak oak = new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with(new PropertyIndexEditorProvider()).with(new NodeCounterEditorProvider()).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
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);
}
Aggregations