Examples of selectorName()


Examples of org.modeshape.jcr.query.model.ReferenceValue.selectorName()

    @Test
    public void shouldParseReferenceValueFromStringWithOnlySelectorNameIfSourceIsNotSelector() {
        Source source = mock(Join.class);
        ReferenceValue value = parser.parseReferenceValue(tokens("tableA)"), typeSystem, source);
        assertThat(value.getPropertyName(), is(nullValue()));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseReferenceValueFromStringWithOnlySelectorNameAndPeriod() {
        parser.parseReferenceValue(tokens("tableA. "), typeSystem, mock(Join.class));
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

    public void shouldParseConstraintFromStringWithOuterParentheses() {
        NamedSelector selector = new NamedSelector(selectorName("tableA"));
        Constraint constraint = parser.parseConstraint(tokens("( ISSAMENODE('/a/b') )"), typeSystem, selector);
        assertThat(constraint, is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)constraint;
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b"));
    }

    @Test
    public void shouldParseConstraintFromStringWithMultipleOuterParentheses() {
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

    public void shouldParseConstraintFromStringWithMultipleOuterParentheses() {
        NamedSelector selector = new NamedSelector(selectorName("tableA"));
        Constraint constraint = parser.parseConstraint(tokens("((( ISSAMENODE('/a/b') )))"), typeSystem, selector);
        assertThat(constraint, is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)constraint;
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b"));
    }

    @Test
    public void shouldParseConstraintFromStringWithParenthesesAndConjunctionAndDisjunctions() {
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(constraint, is(instanceOf(Or.class)));
        Or or = (Or)constraint;

        assertThat(or.left(), is(instanceOf(SameNode.class)));
        SameNode first = (SameNode)or.left();
        assertThat(first.selectorName(), is(selectorName("tableA")));
        assertThat(first.getPath(), is("/a/b"));

        assertThat(or.right(), is(instanceOf(And.class)));
        And and = (And)or.right();
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(or.right(), is(instanceOf(And.class)));
        And and = (And)or.right();

        assertThat(and.left(), is(instanceOf(SameNode.class)));
        SameNode second = (SameNode)and.left();
        assertThat(second.selectorName(), is(selectorName("tableA")));
        assertThat(second.getPath(), is("/c/d"));

        assertThat(and.right(), is(instanceOf(SameNode.class)));
        SameNode third = (SameNode)and.right();
        assertThat(third.selectorName(), is(selectorName("tableA")));
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(second.selectorName(), is(selectorName("tableA")));
        assertThat(second.getPath(), is("/c/d"));

        assertThat(and.right(), is(instanceOf(SameNode.class)));
        SameNode third = (SameNode)and.right();
        assertThat(third.selectorName(), is(selectorName("tableA")));
        assertThat(third.getPath(), is("/e/f"));
    }

    // ----------------------------------------------------------------------------------------------------------------
    // parseConstraint - AND
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(constraint, is(instanceOf(And.class)));
        And and = (And)constraint;

        assertThat(and.left(), is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)and.left();
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b/c"));

        assertThat(and.right(), is(instanceOf(FullTextSearch.class)));
        FullTextSearch search = (FullTextSearch)and.right();
        assertThat(search.selectorName(), is(selectorName("tableA")));
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(constraint, is(instanceOf(And.class)));
        And and = (And)constraint;

        assertThat(and.left(), is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)and.left();
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b/c"));

        assertThat(and.right(), is(instanceOf(And.class)));
        And secondAnd = (And)and.right();
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        assertThat(constraint, is(instanceOf(Or.class)));
        Or or = (Or)constraint;

        assertThat(or.left(), is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)or.left();
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b/c"));

        assertThat(or.right(), is(instanceOf(FullTextSearch.class)));
        FullTextSearch search = (FullTextSearch)or.right();
        assertThat(search.selectorName(), is(selectorName("tableA")));
View Full Code Here

Examples of org.modeshape.jcr.query.model.SameNode.selectorName()

        Constraint constraint = parser.parseConstraint(tokens("NOT(ISSAMENODE(tableA,'/a/b/c'))"), typeSystem, mock(Source.class));
        assertThat(constraint, is(instanceOf(Not.class)));
        Not not = (Not)constraint;
        assertThat(not.getConstraint(), is(instanceOf(SameNode.class)));
        SameNode same = (SameNode)not.getConstraint();
        assertThat(same.selectorName(), is(selectorName("tableA")));
        assertThat(same.getPath(), is("/a/b/c"));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseConstraintFromStringWithNotConstraintWithOutOpeningParenthesis() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.