Search in sources :

Example 31 with NodeState

use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.

the class SecureNodeBuilderTest method testGetNodeStateNonAccessible.

@Test
public void testGetNodeStateNonAccessible() {
    NodeState ns = secureNodeBuilder.getChildNode(NAME_NON_ACCESSIBLE).getNodeState();
    assertTrue(ns instanceof SecureNodeState);
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) Test(org.junit.Test)

Example 32 with NodeState

use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.

the class SecureNodeBuilderTest method testGetBaseStateNonAccessible.

@Test
public void testGetBaseStateNonAccessible() {
    NodeState ns = secureNodeBuilder.getChildNode(NAME_NON_ACCESSIBLE).getBaseState();
    assertTrue(ns instanceof SecureNodeState);
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) Test(org.junit.Test)

Example 33 with NodeState

use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.

the class SecureNodeBuilderTest method testGetBaseState.

@Test
public void testGetBaseState() {
    NodeState ns = secureNodeBuilder.getBaseState();
    assertTrue(ns instanceof SecureNodeState);
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) Test(org.junit.Test)

Example 34 with NodeState

use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.

the class AtomicCounterEditorTest method notCluster.

@Test
public void notCluster() throws CommitFailedException {
    NodeBuilder builder;
    NodeState before, after;
    builder = EMPTY_NODE.builder();
    before = builder.getNodeState();
    builder = setMixin(builder);
    builder = incrementBy(builder, INCREMENT_BY_1);
    after = builder.getNodeState();
    builder = HOOK_NO_CLUSTER.processCommit(before, after, EMPTY).builder();
    assertCounterNodeState(builder, ImmutableSet.of(PREFIX_PROP_COUNTER, PREFIX_PROP_REVISION), 1);
    before = builder.getNodeState();
    builder = incrementBy(builder, INCREMENT_BY_2);
    after = builder.getNodeState();
    builder = HOOK_NO_CLUSTER.processCommit(before, after, EMPTY).builder();
    assertCounterNodeState(builder, ImmutableSet.of(PREFIX_PROP_COUNTER, PREFIX_PROP_REVISION), 3);
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) Test(org.junit.Test)

Example 35 with NodeState

use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.

the class ChangeCollectorProviderTest method testNull.

@Test
public void testNull() {
    NodeBuilder builder = EMPTY_NODE.builder();
    builder.setChildNode("test");
    builder.setChildNode("a1").setChildNode("b1").setProperty("p1", 1);
    NodeState before = builder.getNodeState();
    builder = before.builder();
    builder.setChildNode("a2").setChildNode("b12").setProperty("p12", "12");
    NodeState after = builder.getNodeState();
    assertNull(collectorProvider.getRootValidator(before, after, null));
    assertNull(collectorProvider.getRootValidator(before, after, CommitInfo.EMPTY));
    assertNotNull(collectorProvider.getRootValidator(before, after, newCommitInfoWithCommitContext(CommitInfo.OAK_UNKNOWN, CommitInfo.OAK_UNKNOWN)));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) NodeBuilder(org.apache.jackrabbit.oak.spi.state.NodeBuilder) Test(org.junit.Test)

Aggregations

NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)779 Test (org.junit.Test)498 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)335 EmptyNodeState (org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState)94 ChildNodeEntry (org.apache.jackrabbit.oak.spi.state.ChildNodeEntry)61 PropertyState (org.apache.jackrabbit.oak.api.PropertyState)60 FilterImpl (org.apache.jackrabbit.oak.query.index.FilterImpl)54 CommitFailedException (org.apache.jackrabbit.oak.api.CommitFailedException)48 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)46 NodeStore (org.apache.jackrabbit.oak.spi.state.NodeStore)41 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)36 AbstractNodeState (org.apache.jackrabbit.oak.spi.state.AbstractNodeState)33 Nonnull (javax.annotation.Nonnull)32 Tree (org.apache.jackrabbit.oak.api.Tree)29 ArrayList (java.util.ArrayList)25 NodeStateTestUtils.getNodeState (org.apache.jackrabbit.oak.plugins.migration.NodeStateTestUtils.getNodeState)23 NodeStateTestUtils.getNodeState (org.apache.jackrabbit.oak.upgrade.util.NodeStateTestUtils.getNodeState)23 DocumentNodeState (org.apache.jackrabbit.oak.plugins.document.DocumentNodeState)22 MemoryDocumentStore (org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore)22 CommitInfo (org.apache.jackrabbit.oak.spi.commit.CommitInfo)17