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;
}
Aggregations