Package org.apache.jackrabbit.spi.commons.query.jsr283.qom

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.NodeName


                // TODO decimal
                throw getSyntaxError("number");
            }
        }
        if (currentTokenType == VALUE) {
            Literal literal = factory.literal(currentValue);
            read();
            return literal;
        } else if (currentTokenType == PARAMETER) {
            read();
            String name = readName();
            BindVariableValue var = (BindVariableValue) bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
        } else if (readIf("TRUE")) {
            Literal literal = factory.literal(valueFactory.createValue(true));
            return literal;
        } else if (readIf("FALSE")) {
            Literal literal = factory.literal(valueFactory.createValue(false));
            return literal;
        } else {
            throw getSyntaxError("static operand");
        }
    }
View Full Code Here


    /**
     * Test case for {@link QueryObjectModelFactory#lowerCase(DynamicOperand)}
     */
    public void testLowerCase() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        LowerCase lower = qomFactory.lowerCase(propValue);
        assertTrue("Not a property value operand", lower.getOperand() instanceof PropertyValue);
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeLocalName()}
     */
    public void testNodeLocalName() throws RepositoryException {
        NodeLocalName localName = qomFactory.nodeLocalName();
        assertNull("Selector name must be null", localName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeLocalName(String)}
     */
    public void testNodeLocalNameWithSelector() throws RepositoryException {
        NodeLocalName localName = qomFactory.nodeLocalName(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, localName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName()}
     */
    public void testNodeName() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName();
        assertNull("Selector name must be null", nodeName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName(String)}
     */
    public void testNodeNameWithSelector() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, nodeName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName()}
     */
    public void testNodeName() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName();
        assertNull("Selector name must be null", nodeName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#nodeName(String)}
     */
    public void testNodeNameWithSelector() throws RepositoryException {
        NodeName nodeName = qomFactory.nodeName(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, nodeName.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#not(Constraint)}
     */
    public void testNot() throws RepositoryException {
        PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
        Not not = qomFactory.not(propExist);
        assertTrue("Not a property existence constraint", not.getConstraint() instanceof PropertyExistence);
    }
View Full Code Here

     * Test case for {@link QueryObjectModelFactory#or(Constraint, Constraint)}
     */
    public void testOr() throws RepositoryException {
        PropertyExistence c1 = qomFactory.propertyExistence(propertyName1);
        PropertyExistence c2 = qomFactory.propertyExistence(propertyName2);
        Or or = qomFactory.or(c1, c2);
        assertTrue("Not a PropertyExistence constraint",
                or.getConstraint1() instanceof PropertyExistence);
        assertTrue("Not a PropertyExistence constraint",
                or.getConstraint2() instanceof PropertyExistence);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.query.jsr283.qom.NodeName

Copyright © 2018 www.massapicom. 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.