Examples of selectorName()


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

    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()));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseDynamicOperandFromStringContainingReferenceValueWithNoSelectorIfTheSourceIsNotASelector() {
View Full Code Here

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

        DynamicOperand operand = parser.parseDynamicOperand(tokens("REFERENCE(tableA.property) other"),
                                                            typeSystem,
                                                            mock(Source.class));
        assertThat(operand, is(instanceOf(ReferenceValue.class)));
        ReferenceValue value = (ReferenceValue)operand;
        assertThat(value.selectorName(), is(selectorName("tableA")));
        assertThat(value.getPropertyName(), is("property"));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseDynamicOperandFromStringContainingReferenceValueWithoutClosingParenthesis() {
View Full Code Here

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

    @Test
    public void shouldParseReferenceValueFromStringWithUnquotedSelectorNameAndUnquotedPropertyName() {
        ReferenceValue value = parser.parseReferenceValue(tokens("tableA.property"), typeSystem, mock(Join.class));
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));

        Source source = new NamedSelector(selectorName("tableA"));
        value = parser.parseReferenceValue(tokens("tableA.property"), typeSystem, source);
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
View Full Code Here

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

        assertThat(value.selectorName(), is(selectorName("tableA")));

        Source source = new NamedSelector(selectorName("tableA"));
        value = parser.parseReferenceValue(tokens("tableA.property"), typeSystem, source);
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseReferenceValueFromStringWithQuotedSelectorNameAndUnquotedPropertyName() {
        ReferenceValue value = parser.parseReferenceValue(tokens("[mode:tableA].property"), typeSystem, mock(Join.class));
View Full Code Here

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

    @Test
    public void shouldParseReferenceValueFromStringWithQuotedSelectorNameAndUnquotedPropertyName() {
        ReferenceValue value = parser.parseReferenceValue(tokens("[mode:tableA].property"), typeSystem, mock(Join.class));
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));

        Source source = new NamedSelector(selectorName("mode:tableA"));
        value = parser.parseReferenceValue(tokens("[mode:tableA].property"), typeSystem, source);
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
View Full Code Here

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

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

        Source source = new NamedSelector(selectorName("mode:tableA"));
        value = parser.parseReferenceValue(tokens("[mode:tableA].property"), typeSystem, source);
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
    }

    @Test
    public void shouldParseReferenceValueFromStringWithQuotedSelectorNameAndQuotedPropertyName() {
        ReferenceValue value = parser.parseReferenceValue(tokens("[mode:tableA].[mode:property]"), typeSystem, mock(Join.class));
View Full Code Here

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

    @Test
    public void shouldParseReferenceValueFromStringWithQuotedSelectorNameAndQuotedPropertyName() {
        ReferenceValue value = parser.parseReferenceValue(tokens("[mode:tableA].[mode:property]"), typeSystem, mock(Join.class));
        assertThat(value.getPropertyName(), is("mode:property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));

        Source source = new NamedSelector(selectorName("mode:tableA"));
        value = parser.parseReferenceValue(tokens("[mode:tableA].[mode:property]"), typeSystem, source);
        assertThat(value.getPropertyName(), is("mode:property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
View Full Code Here

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

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

        Source source = new NamedSelector(selectorName("mode:tableA"));
        value = parser.parseReferenceValue(tokens("[mode:tableA].[mode:property]"), typeSystem, source);
        assertThat(value.getPropertyName(), is("mode:property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
    }

    @Test
    public void shouldParseReferenceValueFromStringWithOnlyPropertyNameIfSourceIsSelector() {
        Source source = new NamedSelector(selectorName("tableA"));
View Full Code Here

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

    @Test
    public void shouldParseReferenceValueFromStringWithOnlyPropertyNameIfSourceIsSelector() {
        Source source = new NamedSelector(selectorName("tableA"));
        ReferenceValue value = parser.parseReferenceValue(tokens("property)"), typeSystem, source);
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseReferenceValueFromStringWithMatchingSelectorNameIfSourceIsSelector() {
        Source source = new NamedSelector(selectorName("tableA"));
View Full Code Here

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

    @Test
    public void shouldParseReferenceValueFromStringWithMatchingSelectorNameIfSourceIsSelector() {
        Source source = new NamedSelector(selectorName("tableA"));
        ReferenceValue value = parser.parseReferenceValue(tokens("tableA)"), typeSystem, source);
        assertThat(value.getPropertyName(), is(nullValue()));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseReferenceValueFromStringWithOnlySelectorNameIfSourceIsNotSelector() {
        Source source = mock(Join.class);
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.