Search in sources :

Example 1 with TypePredicate

use of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate in project jackrabbit-oak by apache.

the class NodeTypePredicateTest method multipleNodeTypesMatch.

@Test
public void multipleNodeTypesMatch() {
    NodeState node = createNodeOfType(NT_FILE);
    TypePredicate p = new TypePredicate(node, new String[] { NT_FOLDER, NT_RESOURCE, NT_FILE });
    assertTrue(p.apply(node));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TypePredicate(org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate) Test(org.junit.Test)

Example 2 with TypePredicate

use of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate in project jackrabbit-oak by apache.

the class NodeTypePredicateTest method multipleNodeTypesMiss.

@Test
public void multipleNodeTypesMiss() {
    NodeState node = createNodeOfType(NT_FILE);
    TypePredicate p = new TypePredicate(node, new String[] { NT_FOLDER, NT_RESOURCE, JCR_CONTENT });
    assertFalse(p.apply(node));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TypePredicate(org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate) Test(org.junit.Test)

Example 3 with TypePredicate

use of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate in project jackrabbit-oak by apache.

the class NodeTypePredicateTest method emptyNodeTypeList.

@Test
public void emptyNodeTypeList() {
    NodeState node = createNodeOfType(NT_BASE);
    TypePredicate p = new TypePredicate(node, new String[] {});
    assertFalse(p.apply(node));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TypePredicate(org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate) Test(org.junit.Test)

Example 4 with TypePredicate

use of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate in project jackrabbit-oak by apache.

the class NodeTypePredicateTest method singleNodeTypeMiss.

@Test
public void singleNodeTypeMiss() {
    NodeState node = createNodeOfType(NT_BASE);
    TypePredicate p = new TypePredicate(node, new String[] { NT_FILE });
    assertFalse(p.apply(node));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TypePredicate(org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate) Test(org.junit.Test)

Example 5 with TypePredicate

use of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate in project jackrabbit-oak by apache.

the class NodeTypePredicateTest method singleNodeTypeMatch.

@Test
public void singleNodeTypeMatch() {
    NodeState node = createNodeOfType(NT_BASE);
    TypePredicate p = new TypePredicate(node, new String[] { NT_BASE });
    assertTrue(p.apply(node));
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TypePredicate(org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate) Test(org.junit.Test)

Aggregations

TypePredicate (org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate)10 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)8 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)3 ChildNodeEntry (org.apache.jackrabbit.oak.spi.state.ChildNodeEntry)2 CheckForNull (javax.annotation.CheckForNull)1 Nonnull (javax.annotation.Nonnull)1 PrivilegeBitsProvider (org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeBitsProvider)1 DefaultNodeStateDiff (org.apache.jackrabbit.oak.spi.state.DefaultNodeStateDiff)1 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)1