Package org.apache.jackrabbit.oak.plugins.nodetype

Examples of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate.apply()


    @Test
    public void emptyNodeTypeList() {
        NodeState node = createNodeOfType(NT_BASE);
        TypePredicate p = new TypePredicate(node, new String[] {});
        assertFalse(p.apply(node));
    }

    @Test
    public void singleNodeTypeMatch() {
        NodeState node = createNodeOfType(NT_BASE);
View Full Code Here


    @Test
    public void singleNodeTypeMatch() {
        NodeState node = createNodeOfType(NT_BASE);
        TypePredicate p = new TypePredicate(node, new String[] {NT_BASE});
        assertTrue(p.apply(node));
    }

    @Test
    public void singleNodeTypeMiss() {
        NodeState node = createNodeOfType(NT_BASE);
View Full Code Here

    @Test
    public void singleNodeTypeMiss() {
        NodeState node = createNodeOfType(NT_BASE);
        TypePredicate p = new TypePredicate(node, new String[] {NT_FILE});
        assertFalse(p.apply(node));
    }

    @Test
    public void multipleNodeTypesMatch() {
        NodeState node = createNodeOfType(NT_FILE);
View Full Code Here

    @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));
    }

    @Test
    public void multipleNodeTypesMiss() {
        NodeState node = createNodeOfType(NT_FILE);
View Full Code Here

    @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));
    }

    private static NodeState createNodeOfType(String ntName) {
        return EMPTY_NODE.builder()
                .setProperty(JCR_PRIMARYTYPE, ntName, Type.NAME)
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.