use of org.apache.jackrabbit.oak.spi.state.NodeState 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));
}
use of org.apache.jackrabbit.oak.spi.state.NodeState 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));
}
use of org.apache.jackrabbit.oak.spi.state.NodeState 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));
}
use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.
the class CompositeTreePermissionTest method testMultipleToSingle.
@Test
public void testMultipleToSingle() {
TreePermission rootTp = createRootTreePermission(fullScopeProvider, new NoScopeProvider(root), new NoScopeProvider(root));
assertCompositeTreePermission(true, rootTp);
NodeState childState = rootTree.getChild("test").getNodeState();
TreePermission testTp = rootTp.getChildPermission("test", childState);
TreePermission expected = fullScopeProvider.getTreePermission(rootTree, TreePermission.EMPTY).getChildPermission("test", childState);
assertEquals(expected.getClass(), testTp.getClass());
}
use of org.apache.jackrabbit.oak.spi.state.NodeState in project jackrabbit-oak by apache.
the class CompositeProviderNoScopeTest method testTreePermissionGetChild.
@Override
@Test
public void testTreePermissionGetChild() throws Exception {
List<String> childNames = ImmutableList.of("test", "a", "b", "c", "nonexisting");
Tree rootTree = readOnlyRoot.getTree(ROOT_PATH);
NodeState ns = ((ImmutableTree) rootTree).getNodeState();
TreePermission tp = createPermissionProvider().getTreePermission(rootTree, TreePermission.EMPTY);
assertCompositeTreePermission(tp);
for (String cName : childNames) {
ns = ns.getChildNode(cName);
tp = tp.getChildPermission(cName, ns);
assertCompositeTreePermission(false, tp);
}
}
Aggregations