doTest(br,2,answer,new String[]{"1","7"});
}
public void testBrowseMultiVal(){
BrowseRequest br=new BrowseRequest();
br.setCount(10);
br.setOffset(0);
BrowseSelection sel=new BrowseSelection("multinum");
sel.addValue("001");
sel.addValue("003");
sel.addValue("007");
br.addSelection(sel);
FacetSpec ospec=new FacetSpec();
br.setFacetSpec("multinum", ospec);
br.setSort(new SortField[]{new SortField("multinum",SortField.CUSTOM,true)});
HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
answer.put("multinum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",3),new BrowseFacet("002",1),new BrowseFacet("003",3),new BrowseFacet("007",2),new BrowseFacet("008",1),new BrowseFacet("012",1)}));
doTest(br,6,answer,new String[]{"3","4","7","1","6","5"});
br=new BrowseRequest();
br.setCount(10);
br.setOffset(0);
sel=new BrowseSelection("multinum");
sel.addValue("001");
sel.addValue("002");
sel.addValue("003");
br.addSelection(sel);
sel.setSelectionOperation(ValueOperation.ValueOperationAnd);
doTest(br,1,null,new String[]{"6"});
br=new BrowseRequest();
br.setCount(10);
br.setOffset(0);
sel=new BrowseSelection("multinum");
sel.addValue("001");
sel.addValue("003");
sel.addValue("008");
sel.setSelectionOperation(ValueOperation.ValueOperationOr);
br.addSelection(sel);
sel=new BrowseSelection("color");
sel.addValue("red");
br.addSelection(sel);
ospec=new FacetSpec();
br.setFacetSpec("color", ospec);
ospec=new FacetSpec();
br.setFacetSpec("multinum",ospec);
answer=new HashMap<String,List<BrowseFacet>>();
answer.put("multinum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",1),new BrowseFacet("003",2),new BrowseFacet("008",1)}));
answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",2)}));
doTest(br,2,answer,new String[]{"1","7"});