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

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


    /**
     * 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#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

    // Page 157
    private Ordering[] parseOrder() throws RepositoryException {
        ArrayList orderList = new ArrayList();
        do {
            Ordering ordering;
            DynamicOperand op = parseDynamicOperand();
            if (readIf("DESC")) {
                ordering = factory.descending(op);
            } else {
                readIf("ASC");
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#ascending(DynamicOperand)}
     */
    public void testOrderingAscending() throws RepositoryException {
        PropertyValue op = qomFactory.propertyValue(propertyName1);
        Ordering asc = qomFactory.ascending(op);
        assertEquals("Ordering.getOrder() must return QueryObjectModelConstants.ORDER_ASCENDING",
                QueryObjectModelConstants.ORDER_ASCENDING, asc.getOrder());
        assertTrue("Not a PropertyValue operand", asc.getOperand() instanceof PropertyValue);
    }
View Full Code Here

    public void testCreateQueryWithConstraintAndOrdering() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType);
        PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
View Full Code Here

TOP

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

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.