Examples of NamedSelector


Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(depth.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingDepthWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("DEPTH()"), typeSystem, source);
        assertThat(operand, is(instanceOf(NodeDepth.class)));
        NodeDepth depth = (NodeDepth)operand;
        assertThat(depth.selectorName(), is(selectorName("tableA")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(path.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingPathWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("PATH()"), typeSystem, source);
        assertThat(operand, is(instanceOf(NodePath.class)));
        NodePath path = (NodePath)operand;
        assertThat(path.selectorName(), is(selectorName("tableA")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(name.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingNameWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("NAME()"), typeSystem, source);
        assertThat(operand, is(instanceOf(NodeName.class)));
        NodeName name = (NodeName)operand;
        assertThat(name.selectorName(), is(selectorName("tableA")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(name.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingLocalNameWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("LOCALNAME()"), typeSystem, source);
        assertThat(operand, is(instanceOf(NodeLocalName.class)));
        NodeLocalName name = (NodeLocalName)operand;
        assertThat(name.selectorName(), is(selectorName("tableA")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(score.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingFullTextSearchScoreWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("SCORE()"), typeSystem, source);
        assertThat(operand, is(instanceOf(FullTextSearchScore.class)));
        FullTextSearchScore score = (FullTextSearchScore)operand;
        assertThat(score.selectorName(), is(selectorName("tableA")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringWithOnlyPropertyNameIfSourceIsSelector() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("property"), typeSystem, source);
        assertThat(operand, is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)operand;
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(value.getPropertyName(), is(nullValue()));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingReferenceValueWithNoSelectorOnlyIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("REFERENCE()"), typeSystem, source);
        assertThat(operand, is(instanceOf(ReferenceValue.class)));
        ReferenceValue value = (ReferenceValue)operand;
        assertThat(value.selectorName(), is(selectorName("tableA")));
        assertThat(value.getPropertyName(), is(nullValue()));
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(value.getPropertyName(), is(nullValue()));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingReferenceValueWithWithOnlyPropertyNameIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("REFERENCE(property) other"), typeSystem, source);
        assertThat(operand, is(instanceOf(ReferenceValue.class)));
        ReferenceValue value = (ReferenceValue)operand;
        assertThat(value.selectorName(), is(selectorName("tableA")));
        assertThat(value.getPropertyName(), is("property"));
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(value.getPropertyName(), is("property"));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingReferenceValueWithWithSelectorNameAndPropertyNameIfThereIsOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("REFERENCE(tableA.property) other"), typeSystem, source);
        assertThat(operand, is(instanceOf(ReferenceValue.class)));
        ReferenceValue value = (ReferenceValue)operand;
        assertThat(value.selectorName(), is(selectorName("tableA")));
        assertThat(value.getPropertyName(), is("property"));
View Full Code Here

Examples of org.modeshape.jcr.query.model.NamedSelector

        assertThat(value.getPropertyName(), is("property"));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingReferenceValueWithWithOnlySelectorNameMatchingThatOfOneSelectorAsSource() {
        Source source = new NamedSelector(selectorName("tableA"));
        DynamicOperand operand = parser.parseDynamicOperand(tokens("REFERENCE(tableA) other"), typeSystem, source);
        assertThat(operand, is(instanceOf(ReferenceValue.class)));
        ReferenceValue value = (ReferenceValue)operand;
        assertThat(value.selectorName(), is(selectorName("tableA")));
        assertThat(value.getPropertyName(), is(nullValue()));
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.