private void helpTestAllSorts(int batches) throws Exception {
ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);
List elements = new ArrayList();
elements.add(es1);
int rows = batches * BATCH_SIZE;
ListNestedSortComparator<Integer> comparator = new ListNestedSortComparator<Integer>(new int[] {0}, OrderBy.DESC);
List<Integer>[] expected = new List[rows];
List<Integer>[] data = new List[rows];
TreeSet<List<Integer>> distinct = new TreeSet<List<Integer>>(comparator);
for(int i=0; i<rows; i++) {
Integer value = new Integer((i*51) % 11);
data[i] = Arrays.asList(value);
expected[i] = Arrays.asList(value);
distinct.add(Arrays.asList(value));
}
List[] expectedDistinct = distinct.toArray(new List[distinct.size()]);
List sortElements = new ArrayList();
sortElements.add(es1);
List sortTypes = new ArrayList();
sortTypes.add(new Boolean(OrderBy.DESC));
Arrays.sort(expected, comparator);
for (Mode mode : Mode.values()) {
helpTestSort(elements, data, sortElements, sortTypes, mode==Mode.SORT?expected:expectedDistinct, mode);