Package org.apache.jackrabbit.core.query.jsr283.qom

Examples of org.apache.jackrabbit.core.query.jsr283.qom.PropertyValue


    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qomFactory.selector(testNodeType);
        PropertyExistence propExist = qomFactory.propertyExistence(propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        Column column = qomFactory.column(propertyName1);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        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


    public void testComparison() throws RepositoryException {
        PropertyValue op1 = qomFactory.propertyValue(propertyName1);
        BindVariableValue op2 = qomFactory.bindVariable(VARIABLE_NAME);
        for (Iterator it = OPERATORS.iterator(); it.hasNext(); ) {
            int operator = ((Integer) it.next()).intValue();
            Comparison comp = qomFactory.comparison(op1, operator, op2);
            assertTrue("Not a PropertyValue operand", comp.getOperand1() instanceof PropertyValue);
            assertTrue("Not a BindVariableValue operand", comp.getOperand2() instanceof BindVariableValue);
            assertEquals("Wrong operator", operator, comp.getOperator());
        }
    }
View Full Code Here

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

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

    /**
     * Test case for {@link QueryObjectModelFactory#descendantNodeJoinCondition(String, String)}
     */
    public void testDescendantNodeJoinCondition() throws RepositoryException {
        DescendantNodeJoinCondition cond = qomFactory.descendantNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getDescendantSelectorName());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getAncestorSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#equiJoinCondition(String, String, String, String)}
     */
    public void testEquiJoinCondition() throws RepositoryException {
        EquiJoinCondition cond = qomFactory.equiJoinCondition(SELECTOR_NAME1, propertyName1, SELECTOR_NAME2, propertyName2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name());
        assertEquals("Wrong property name", propertyName1, cond.getProperty1Name());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name());
        assertEquals("Wrong property name", propertyName2, cond.getProperty2Name());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String)}
     */
    public void testFullTextSearch() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(propertyName1, FULLTEXT_SEARCH_EXPR);
        assertNull("Selector must be null", ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String)}
     */
    public void testFullTextSearchAllProperties() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(null, FULLTEXT_SEARCH_EXPR);
        assertNull("Selector must be null", ftSearch.getSelectorName());
        assertNull("Property name must be null", ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
     */
    public void testFullTextSearchWithSelector() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

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

TOP

Related Classes of org.apache.jackrabbit.core.query.jsr283.qom.PropertyValue

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.