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

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


    /**
     * 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#propertyValue(String)}
     */
    public void testPropertyValue() throws RepositoryException {
        PropertyValue propVal = qomFactory.propertyValue(propertyName1);
        assertNull("Selector name must be null", propVal.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propVal.getPropertyName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#propertyValue(String, String)}
     */
    public void testPropertyValueWithSelector() throws RepositoryException {
        PropertyValue propVal = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, propVal.getSelectorName());
        assertEquals("Wrong property name", propertyName1, propVal.getPropertyName());
    }
View Full Code Here

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

    /**
     * Test case for {@link QueryObjectModelFactory#sameNode(String)}
     */
    public void testSameNode() throws RepositoryException {
        SameNode sameNode = qomFactory.sameNode(testRootNode.getPath());
        assertNull("Selector name must be null", sameNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), sameNode.getPath());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#sameNode(String, String)}
     */
    public void testSameNodeWithSelector() throws RepositoryException {
        SameNode sameNode = qomFactory.sameNode(SELECTOR_NAME1, testRootNode.getPath());
        assertEquals("Wrong selector name", SELECTOR_NAME1, sameNode.getSelectorName());
        assertEquals("Wrong path", testRootNode.getPath(), sameNode.getPath());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#sameNodeJoinCondition(String, String)}
     */
    public void testSameNodeJoinCondition() throws RepositoryException {
        SameNodeJoinCondition cond = qomFactory.sameNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name());
        assertNull("Path must be null", cond.getSelector2Path());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#sameNodeJoinCondition(String, String, String)}
     */
    public void testSameNodeJoinConditionWithPath() throws RepositoryException {
        SameNodeJoinCondition cond = qomFactory.sameNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2, nodeName1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name());
        assertEquals("Wrong path", nodeName1, cond.getSelector2Path());
    }
View Full Code Here

        }
    }

    // Page 129
    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            int type;
            if (readIf("RIGHT")) {
View Full Code Here

        ArrayList columns = new ArrayList();
        for (int i = 0; i < list.size(); i++) {
            ColumnOrWildcard c = (ColumnOrWildcard) list.get(i);
            if (c.propertyName == null) {
                for (int j = 0; j < selectors.size(); j++) {
                    Selector selector = (Selector) selectors.get(j);
                    if (c.selectorName == null
                            || c.selectorName
                                    .equals(selector.getSelectorName())) {
                        Column column = factory.column(selector
                                .getSelectorName(), null, null);
                        columns.add(column);
                    }
                }
            } else {
View Full Code Here

TOP

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

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.