Package org.modeshape.jcr.query.model

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


        LowerCase lower = (LowerCase)operand;
        assertThat(lower.selectorName(), is(selectorName("tableA")));
        assertThat(lower.getOperand(), is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)lower.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));

        Source source = new NamedSelector(selectorName("tableA"));
        operand = parser.parseDynamicOperand(tokens("LOWER(property)"), typeSystem, source);
        assertThat(operand, is(instanceOf(LowerCase.class)));
        lower = (LowerCase)operand;
View Full Code Here


        lower = (LowerCase)operand;
        assertThat(lower.selectorName(), is(selectorName("tableA")));
        assertThat(lower.getOperand(), is(instanceOf(PropertyValue.class)));
        value = (PropertyValue)lower.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingLowerOfUpperCaseOfAnotherOperand() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("LOWER(UPPER(tableA.property))"),
View Full Code Here

        UpperCase upper = (UpperCase)lower.getOperand();
        assertThat(upper.selectorName(), is(selectorName("tableA")));
        assertThat(upper.getOperand(), is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)upper.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseDynamicOperandFromStringContainingLowerWithoutClosingParenthesis() {
        parser.parseDynamicOperand(tokens("LOWER(tableA.property other"), typeSystem, mock(Source.class));
View Full Code Here

        UpperCase upper = (UpperCase)operand;
        assertThat(upper.selectorName(), is(selectorName("tableA")));
        assertThat(upper.getOperand(), is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)upper.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));

        Source source = new NamedSelector(selectorName("tableA"));
        operand = parser.parseDynamicOperand(tokens("UPPER(property)"), typeSystem, source);
        assertThat(operand, is(instanceOf(UpperCase.class)));
        upper = (UpperCase)operand;
View Full Code Here

        upper = (UpperCase)operand;
        assertThat(upper.selectorName(), is(selectorName("tableA")));
        assertThat(upper.getOperand(), is(instanceOf(PropertyValue.class)));
        value = (PropertyValue)upper.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringContainingUpperOfLowerCaseOfAnotherOperand() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("UPPER(LOWER(tableA.property))"),
View Full Code Here

        LowerCase lower = (LowerCase)upper.getOperand();
        assertThat(lower.selectorName(), is(selectorName("tableA")));
        assertThat(lower.getOperand(), is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)lower.getOperand();
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test( expected = ParsingException.class )
    public void shouldFailToParseDynamicOperandFromStringContainingUpperWithoutClosingParenthesis() {
        parser.parseDynamicOperand(tokens("UPPER(tableA.property other"), typeSystem, mock(Source.class));
View Full Code Here

    public void shouldParseDynamicOperandFromStringWithUnquotedSelectorNameAndUnquotedPropertyName() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("tableA.property"), typeSystem, mock(Join.class));
        assertThat(operand, is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)operand;
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringWithQuotedSelectorNameAndUnquotedPropertyName() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("[mode:tableA].property"), typeSystem, mock(Join.class));
View Full Code Here

    public void shouldParseDynamicOperandFromStringWithQuotedSelectorNameAndUnquotedPropertyName() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("[mode:tableA].property"), typeSystem, mock(Join.class));
        assertThat(operand, is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)operand;
        assertThat(value.getPropertyName(), is("property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
    }

    @Test
    public void shouldParseDynamicOperandFromStringWithQuotedSelectorNameAndQuotedPropertyName() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("[mode:tableA].[mode:property]"), typeSystem, mock(Join.class));
View Full Code Here

    public void shouldParseDynamicOperandFromStringWithQuotedSelectorNameAndQuotedPropertyName() {
        DynamicOperand operand = parser.parseDynamicOperand(tokens("[mode:tableA].[mode:property]"), typeSystem, mock(Join.class));
        assertThat(operand, is(instanceOf(PropertyValue.class)));
        PropertyValue value = (PropertyValue)operand;
        assertThat(value.getPropertyName(), is("mode:property"));
        assertThat(value.selectorName(), is(selectorName("mode:tableA")));
    }

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

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

    @Test( expected = ParsingException.class )
    public void shouldFailToDynamicOperandValueFromStringWithOnlyPropertyNameIfSourceIsNotSelector() {
        parser.parsePropertyValue(tokens("property"), typeSystem, 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.