final public void testSearchQueryCreatorHitExtractorFilter() throws Exception {
Analyzer analyzer = new SimpleAnalyzer();
MockControl searcherFactoryControl = MockControl.createStrictControl(SearcherFactory.class);
SearcherFactory searcherFactory = (SearcherFactory)searcherFactoryControl.getMock();
MockControl searcherControl = MockControl.createStrictControl(LuceneSearcher.class);
LuceneSearcher searcher = (LuceneSearcher)searcherControl.getMock();
MockControl queryCreatorControl = MockControl.createStrictControl(QueryCreator.class);
QueryCreator queryCreator = (QueryCreator)queryCreatorControl.getMock();
MockControl hitsControl = MockControl.createStrictControl(LuceneHits.class);
LuceneHits hits = (LuceneHits)hitsControl.getMock();
MockControl hitExtractorControl = MockControl.createStrictControl(HitExtractor.class);
HitExtractor hitExtractor = (HitExtractor)hitExtractorControl.getMock();
//query
Query query = new TermQuery(new Term("field", "sample"));
//filter
TermQuery filterQuery = new TermQuery(new Term("filter", "another"));
Filter filter = new QueryFilter(filterQuery);
//document
Document document = new Document();
document.add(new Field("field", "a sample", Field.Store.YES, Field.Index.TOKENIZED));
document.add(new Field("filter", "a sample filter", Field.Store.YES, Field.Index.TOKENIZED));
document.add(new Field("sort", "2", Field.Store.YES, Field.Index.UN_TOKENIZED));
Object obj = new Object();
searcherFactory.getSearcher();
searcherFactoryControl.setReturnValue(searcher, 1);
queryCreator.createQuery(analyzer);
queryCreatorControl.setReturnValue(query, 1);
searcher.search(query, filter);
searcherControl.setReturnValue(hits, 1);
hits.length();
hitsControl.setReturnValue(1, 1);
hits.id(0);
hitsControl.setReturnValue(1, 1);
hits.doc(0);
hitsControl.setReturnValue(document, 1);
hits.score(0);
hitsControl.setReturnValue((float)1, 1);
hitExtractor.mapHit(1, document, 1);
hitExtractorControl.setReturnValue(obj, 1);
hits.length();
hitsControl.setReturnValue(1, 1);
searcher.close();
searcherControl.setVoidCallable(1);
searcherFactoryControl.replay();
searcherControl.replay();
queryCreatorControl.replay();