Ignore:
Timestamp:
02/18/14 07:15:00 (10 years ago)
Author:
twagoo
Message:

started implementation of search results. Created panel and added required service interfaces/implementations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/wicket/pages/TestFacetedSearchPage.java

    r4519 r4530  
    66import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
    77import eu.clarin.cmdi.vlo.service.FacetFieldsService;
     8import eu.clarin.cmdi.vlo.service.SolrDocumentService;
    89import java.util.Arrays;
    910import java.util.List;
    1011import org.apache.solr.client.solrj.response.FacetField;
     12import org.apache.solr.common.SolrDocument;
    1113import org.apache.wicket.util.tester.WicketTester;
    1214import org.jmock.Expectations;
     
    5052        }
    5153
     54        @Override
     55        public SolrDocumentService documentService() {
     56            return mockery().mock(SolrDocumentService.class);
     57        }
    5258    }
    5359
     
    5965    @Autowired
    6066    private FacetFieldsService facetFieldsService;
     67    @Autowired
     68    private SolrDocumentService documentService;
    6169
    6270    @Before
     
    7078        mockery.checking(new Expectations() {
    7179            {
     80                // mock facets
    7281                atLeast(1).of(facetFieldsService).getFacetFieldCount();
    7382                will(returnValue(2L));
    7483                oneOf(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class)));
    7584                will(returnValue(Arrays.asList(new FacetField("language"), new FacetField("resource class"))));
     85               
     86                // mock search results
     87                atLeast(1).of(documentService).getDocumentCount(with(any(QueryFacetsSelection.class)));
     88                will(returnValue(1000L));
     89                oneOf(documentService).getDocuments(with(any(QueryFacetsSelection.class)), with(equal(0)), with(equal(10)));
     90                will(returnValue(Arrays.asList(new SolrDocument(), new SolrDocument())));
    7691            }
    7792        });
Note: See TracChangeset for help on using the changeset viewer.