// no sel
BrowseRequest br = new BrowseRequest();
br.setCount(10);
br.setOffset(0);
br.setSort(new SortField[] { new SortField("number", SortField.Type.CUSTOM, true) });
doTest(br, 7, null, new String[] { "6", "5", "4", "3", "2", "1", "7" });
br.setSort(new SortField[] { new SortField("name", SortField.Type.STRING, false) });
doTest(br, 7, null, new String[] { "7", "4", "6", "2", "3", "1", "5" });
BrowseSelection sel = new BrowseSelection("color");
sel.addValue("red");
br.addSelection(sel);
br.setSort(new SortField[] { new SortField("number", SortField.Type.CUSTOM, true) });
doTest(br, 3, null, new String[] { "2", "1", "7" });
br.setSort(new SortField[] { new SortField("name", SortField.Type.STRING, false) });
doTest(br, 3, null, new String[] { "7", "2", "1" });
sel.addValue("blue");
br.setQuery(new TermQuery(new Term("shape", "square")));
br.setSort(new SortField[] { new SortField("number", SortField.Type.CUSTOM, true) });
doTest(br, 3, null, new String[] { "5", "1", "7" });
br.setSort(new SortField[] { new SortField("name", SortField.Type.STRING, false) });
doTest(br, 3, null, new String[] { "7", "1", "5" });
}