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

                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 {
                Column column;
                if (c.selectorName != null) {
                    column = factory.column(c.selectorName, c.propertyName, c.columnName);
                } else if (c.columnName != null) {
                    column = factory.column(c.propertyName, c.columnName);
                } else {
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

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

    public void testCreateQueryWithConstraintOrderingAndColumn() throws RepositoryException {
        Selector 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 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

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.