Search in sources :

Example 1 with OrderSpec

use of org.exist.xquery.OrderSpec in project exist by eXist-db.

the class OrderedValueSequenceTest method mockOrderedValueSequence.

private static OrderedValueSequence mockOrderedValueSequence(final int size) throws XPathException {
    final Expression mockSortExpr = createMock(Expression.class);
    expect(mockSortExpr.eval(null)).andReturn(Sequence.EMPTY_SEQUENCE).anyTimes();
    replay(mockSortExpr);
    final OrderedValueSequence orderedValueSequence = new OrderedValueSequence(new OrderSpec[] { new OrderSpec(null, mockSortExpr) }, size);
    for (int i = 0; i < size; i++) {
        final Item item = createMock(Item.class);
        expect(item.getType()).andReturn(Type.ANY_TYPE);
        replay(item);
        orderedValueSequence.add(item);
    }
    return orderedValueSequence;
}
Also used : OrderSpec(org.exist.xquery.OrderSpec) Expression(org.exist.xquery.Expression)

Aggregations

Expression (org.exist.xquery.Expression)1 OrderSpec (org.exist.xquery.OrderSpec)1