FileDocCategorySizeDatePackage
TestSearchingList.javaAPI DocApache Lucene 2.0.01545Fri May 26 09:53:46 BST 2006org.apache.lucene.swing.models

TestSearchingList

public class TestSearchingList extends TestCase
author
Jonathan Simon - jonathan_s_simon@yahoo.com

Fields Summary
private ListModel
baseListModel
private ListSearcher
listSearcher
Constructors Summary
Methods Summary
protected voidsetUp()

        baseListModel = new BaseListModel(DataStore.getRestaurants());
        listSearcher = new ListSearcher(baseListModel);
    
public voidtestSearch()

        //make sure data is there
        assertEquals(baseListModel.getSize(), listSearcher.getSize());
        //search for pino's
        listSearcher.search("pino's");
        assertEquals(1, listSearcher.getSize());
        //clear search and check that
        listSearcher.search(null);
        assertEquals(baseListModel.getSize(), listSearcher.getSize());