* Test for search functionality.
*/
public class SearchTest extends AbstractAccessControlTest {
public void testSearch() throws Exception {
LuceneCocoonSearcher searcher = null;
IndexManager indexManager = null;
try {
searcher = (LuceneCocoonSearcher) getManager().lookup(LuceneCocoonSearcher.ROLE);
indexManager = (IndexManager) getManager().lookup(IndexManager.ROLE);
Index index = indexManager.getIndex("test-authoring");
searcher.setDirectory(index.getDirectory());
Term term = new Term("body", "tutorial");
Query query = new TermQuery(term);
Hits hits = searcher.search(query);
/*
* The indexing doesn't work at the moment when the tests are executed because the
* cocoon:// protocol is not supported in the test environment.
*