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

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


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


    /**
     * Test case for {@link QueryObjectModelFactory#bindVariable(String)}
     */
    public void testBindVariableValue() throws RepositoryException {
        BindVariableValue bindVar = qomFactory.bindVariable(propertyName1);
        assertEquals("Wrong variable name", propertyName1, bindVar.getBindVariableName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#comparison(DynamicOperand, int, StaticOperand)}
     */
    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);
View Full Code Here

            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;
View Full Code Here

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

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

    /**
     * Test case for {@link QueryObjectModelFactory#childNodeJoinCondition(String, String)}
     */
    public void testChildNodeJoinCondition() throws RepositoryException {
        ChildNodeJoinCondition cond = qomFactory.childNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2);
        assertEquals("Wrong selector name", cond.getChildSelectorName(), SELECTOR_NAME1);
        assertEquals("Wrong selector name", cond.getParentSelectorName(), SELECTOR_NAME2);
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String)}
     */
    public void testColumn() throws RepositoryException {
        Column col = qomFactory.column(propertyName1);
        assertNull("Selector must be null", col.getSelectorName());
        assertEquals("Wrong property name", propertyName1, col.getPropertyName());
        assertEquals("Wrong column name", propertyName1, col.getColumnName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String)}
     */
    public void testColumnAllProperties() throws RepositoryException {
        Column col = qomFactory.column(null);
        assertNull("Selector must be null", col.getSelectorName());
        assertNull("Property name must be null", col.getPropertyName());
        assertNull("Column name must be null", col.getColumnName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String, String)}
     */
    public void testColumnWithColumnName() throws RepositoryException {
        Column col = qomFactory.column(propertyName1, COLUMN_NAME);
        assertNull("Selector must be null", col.getSelectorName());
        assertEquals("Wrong property name", propertyName1, col.getPropertyName());
        assertEquals("Wrong column name", COLUMN_NAME, col.getColumnName());
    }
View Full Code Here

TOP

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

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.