Examples of IndexFactory


Examples of org.springmodules.lucene.index.factory.IndexFactory

    listenerControl.verify();
  }

  final public void testIndexDataSourceboolean() throws Exception {
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexWriterControl = MockControl.createStrictControl(LuceneIndexWriter.class);
    LuceneIndexWriter indexWriter = (LuceneIndexWriter)indexWriterControl.getMock();
    MockControl listenerControl = MockControl.createControl(DatabaseIndexingListener.class);
    DatabaseIndexingListener listener = (DatabaseIndexingListener)listenerControl.getMock();

    //requests
    SqlRequest request1 = new SqlRequest("select * from test");
    SqlRequest request2 = new SqlRequest("select * from test");

    //documents
    final Document document1 = new Document();
    document1.add(new Field("contents", "test_name", Field.Store.NO, Field.Index.TOKENIZED));
    final Document document2 = new Document();
    document2.add(new Field("contents", "test_name", Field.Store.NO, Field.Index.TOKENIZED));

    indexFactory.getIndexWriter();
    indexFactoryControl.setReturnValue(indexWriter, 1);
   
    listener.beforeIndexingRequest(request1);
    listenerControl.setVoidCallable(1);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.