Package org.apache.jackrabbit.oak.spi.query

Examples of org.apache.jackrabbit.oak.spi.query.Filter


    public void costGreaterThanAscendingDirection() throws Exception {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineAscendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In ascending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
    }
View Full Code Here


    public void costGreaterThanEqualAscendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineAscendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.firstIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In ascending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
    }
View Full Code Here

    public void costLessThanAscendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineAscendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.last = PropertyValues.newDate("2013-01-01");
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertEquals("in ascending index we're not expecting to serve '<' queries",
            Double.POSITIVE_INFINITY, index.getCost(filter, root), 0);
    }
View Full Code Here

    public void costLessThanEqualsAscendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineAscendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.last = PropertyValues.newDate("2013-01-01");
        restriction.lastIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertEquals("in ascending index we're not expecting to serve '<=' queries",
            Double.POSITIVE_INFINITY, index.getCost(filter, root), 0);
    }
View Full Code Here

    public void costGreaterThanDescendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineDescendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertEquals("in descending index we're not expecting to serve '>' queries",
            Double.POSITIVE_INFINITY, index.getCost(filter, root), 0);
View Full Code Here

    public void costGreaterEqualThanDescendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineDescendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.firstIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertEquals("in descending index we're not expecting to serve '>' queries",
            Double.POSITIVE_INFINITY, index.getCost(filter, root), 0);
View Full Code Here

    public void costLessThanDescendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineDescendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.last = PropertyValues.newDate("2013-01-01");
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In descending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
View Full Code Here

    public void costLessThanEqualDescendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineDescendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.last = PropertyValues.newDate("2013-01-01");
        restriction.lastIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In descending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
View Full Code Here

    public void costBetweenDescendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineDescendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.last = PropertyValues.newDate("2013-01-02");
        restriction.firstIncluding = true;
        restriction.lastIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In descending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
View Full Code Here

    public void costBetweenAscendingDirection() throws IllegalArgumentException, RepositoryException {
        OrderedPropertyIndex index = new OrderedPropertyIndex();
        NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder();
        defineAscendingIndex(builder);
        NodeState root = builder.getNodeState();
        Filter filter = createNiceMock(Filter.class);
        Filter.PropertyRestriction restriction = new Filter.PropertyRestriction();
        restriction.first = PropertyValues.newDate("2013-01-01");
        restriction.last = PropertyValues.newDate("2013-01-02");
        restriction.firstIncluding = true;
        restriction.lastIncluding = true;
        restriction.propertyName = ORDERED_PROPERTY;
        expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction))
            .anyTimes();
        expect(filter.containsNativeConstraint()).andReturn(false).anyTimes();
        replay(filter);

        assertFalse("In descending order we're expeting to serve this kind of queries",
            Double.POSITIVE_INFINITY == index.getCost(filter, root));
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.query.Filter

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.