* Test pour void index(String) with document handler registered
*/
final public void testIndexStringListener() throws Exception {
SimpleAnalyzer analyzer = new SimpleAnalyzer();
MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
MockControl indexWriterControl = MockControl.createStrictControl(LuceneIndexWriter.class);
LuceneIndexWriter indexWriter = (LuceneIndexWriter)indexWriterControl.getMock();
MockControl listener1Control = MockControl.createStrictControl(FileDocumentIndexingListener.class);
FileDocumentIndexingListener listener1 = (FileDocumentIndexingListener)listener1Control.getMock();
MockControl listener2Control = MockControl.createStrictControl(FileDocumentIndexingListener.class);
FileDocumentIndexingListener listener2 = (FileDocumentIndexingListener)listener2Control.getMock();
//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));
indexFactory.getIndexWriter();
indexFactoryControl.setReturnValue(indexWriter, 1);
listener1.beforeIndexingDirectory(getBaseDirectoryToIndex());
listener1Control.setVoidCallable(1);