Examples of builder()


Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test(expected = CommitFailedException.class)
    public void testUniqueByTypeKO() throws Exception {
        NodeState root = EMPTY_NODE;

        // Add index definition
        NodeBuilder builder = root.builder();
        createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
                "fooIndex", true, true, ImmutableSet.of("foo"),
                ImmutableSet.of("typeFoo"));
        NodeState before = builder.getNodeState();
        builder.child("a").setProperty(JCR_PRIMARYTYPE, "typeFoo", Type.NAME)
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test
    public void testUniqueByTypeDelete() throws Exception {
        NodeState root = EMPTY_NODE;

        // Add index definition
        NodeBuilder builder = root.builder();
        createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME),
                "fooIndex", true, true, ImmutableSet.of("foo"),
                ImmutableSet.of("typeFoo"));
        builder.child("a").setProperty(JCR_PRIMARYTYPE, "typeFoo", Type.NAME)
                .setProperty("foo", "abc");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    public void testChangesFromRoot() throws CommitFailedException {
        NodeState oldState = root.getRoot();
        assertEquals(oldState, left.getRoot());
        assertEquals(oldState, right.getRoot());

        NodeBuilder builder = oldState.builder();
        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        root.merge(builder, EmptyHook.INSTANCE, PostCommitHook.EMPTY);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    public void testChangesToRoot() throws CommitFailedException {
        NodeState oldState = root.getRoot();
        assertEquals(oldState, left.getRoot());
        assertEquals(oldState, right.getRoot());

        NodeBuilder builder = oldState.builder();
        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        left.merge(builder, EmptyHook.INSTANCE, PostCommitHook.EMPTY);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    public void testConcurrentChanges() throws CommitFailedException {
        NodeState oldState = root.getRoot();
        assertEquals(oldState, left.getRoot());
        assertEquals(oldState, right.getRoot());

        NodeBuilder leftBuilder = oldState.builder();
        leftBuilder.setProperty("foo", "bar");
        NodeState leftState = leftBuilder.getNodeState();

        left.merge(leftBuilder, EmptyHook.INSTANCE, PostCommitHook.EMPTY);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

            builder.child("test" + i);
        }
        NodeState before = writer.writeNode(builder.getNodeState());
        assertEquals(builder.getNodeState(), before);

        builder = before.builder();
        for (int i = 0; i < 900; i++) {
            builder.getChildNode("test" + i).remove();
        }
        NodeState after = writer.writeNode(builder.getNodeState());
        assertEquals(builder.getNodeState(), after);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test
    public void ignoreHidden() throws CommitFailedException {
        EditorHook hook = new EditorHook(new TypeEditorProvider());

        NodeState root = INITIAL_CONTENT;
        NodeBuilder builder = root.builder();

        NodeState before = builder.getNodeState();
        builder.child(":hidden");
        NodeState after = builder.getNodeState();
        hook.processCommit(before, after);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test
    public void costEstimation() throws Exception {
        NodeState root = INITIAL_CONTENT;

        // Add index definition
        NodeBuilder builder = root.builder();
        createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME), "foo",
                true, false, ImmutableSet.of("foo"), null);
        NodeState before = builder.getNodeState();

        // Add some content and process it through the property index hook
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test
    public void costMaxEstimation() throws Exception {
        NodeState root = EmptyNodeState.EMPTY_NODE;

        // Add index definition
        NodeBuilder builder = root.builder();
        createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME), "foo",
                true, false, ImmutableSet.of("foo"), null);
        NodeState before = builder.getNodeState();

        // 100 nodes in the index:
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.builder()

    @Test
    public void testPropertyLookup() throws Exception {
        NodeState root = INITIAL_CONTENT;

        // Add index definition
        NodeBuilder builder = root.builder();
        createIndexDefinition(builder.child(INDEX_DEFINITIONS_NAME), "foo",
                true, false, ImmutableSet.of("foo"), null);
        NodeState before = builder.getNodeState();

        // Add some content and process it through the property index hook
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.