Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.FullTextSearch


    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
     */
    public void testFullTextSearchWithSelector() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
        // TODO is there some way to check the contents of a StaticOperand?
    }
View Full Code Here


    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String)}
     */
    public void testFullTextSearchAllProperties() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(SELECTOR_NAME1, null, FULLTEXT_SEARCH_EXPR);
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertNull("Property name must be null", ftSearch.getPropertyName());
        // TODO is there some way to check the contents of a StaticOperand?
    }
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());
        // TODO is there some way to check the contents of a StaticOperand?
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearch() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, propertyName1,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a Literal", op instanceof Literal);
        Literal literal = (Literal) op;
        assertEquals(FULLTEXT_SEARCH_EXPR, literal.getLiteralValue().getString());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearchAllProperties() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, null,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertNull("Property name must be null", ftSearch.getPropertyName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearchWithBindVariableValue() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, propertyName1,
                qf.bindVariable(VARIABLE_NAME));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a BindVariableValue", op instanceof BindVariableValue);
        BindVariableValue value = (BindVariableValue) op;
        assertEquals(VARIABLE_NAME, value.getBindVariableName());
    }
View Full Code Here

            return Collections.singleton(cn.getSelectorName());
        } else if (constraint instanceof DescendantNode) {
            DescendantNode dn = (DescendantNode) constraint;
            return Collections.singleton(dn.getSelectorName());
        } else if (constraint instanceof FullTextSearch) {
            FullTextSearch fts = (FullTextSearch) constraint;
            return Collections.singleton(fts.getSelectorName());
        } else {
            throw new UnsupportedRepositoryOperationException(
                    "Unknown constraint type: " + constraint);
        }
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearch() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, propertyName1,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a Literal", op instanceof Literal);
        Literal literal = (Literal) op;
        assertEquals(FULLTEXT_SEARCH_EXPR, literal.getLiteralValue().getString());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearchAllProperties() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, null,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertNull("Property name must be null", ftSearch.getPropertyName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, StaticOperand)}
     */
    public void testFullTextSearchWithBindVariableValue() throws RepositoryException {
        FullTextSearch ftSearch = qf.fullTextSearch(
                SELECTOR_NAME1, propertyName1,
                qf.bindVariable(VARIABLE_NAME));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a BindVariableValue", op instanceof BindVariableValue);
        BindVariableValue value = (BindVariableValue) op;
        assertEquals(VARIABLE_NAME, value.getBindVariableName());
    }
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.FullTextSearch

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.