Examples of IndexFactory


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

    } catch(Exception ex) {}
  }

  public void testIndexFactorySpecified() throws Exception {
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();

    LuceneIndexSupport luceneIndex = new LuceneIndexSupport() {};
    luceneIndex.setIndexFactory(indexFactory);
   
    luceneIndex.afterPropertiesSet();
View Full Code Here

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

    luceneIndex.afterPropertiesSet();
  }

  public void testTemplateCreation() throws Exception {
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();

    LuceneIndexSupport luceneIndex = new LuceneIndexSupport() {};
    luceneIndex.setIndexFactory(indexFactory);
   
    luceneIndex.afterPropertiesSet();
View Full Code Here

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

  public void testGetObject() throws Exception {
    SimpleIndexFactoryBean simpleIndexFactoryBean = new SimpleIndexFactoryBean();
    simpleIndexFactoryBean.setDirectory(new RAMDirectory());
    simpleIndexFactoryBean.afterPropertiesSet();

    IndexFactory indexFactory = (IndexFactory)simpleIndexFactoryBean.getObject();
    assertNotNull(indexFactory);
    assertEquals(indexFactory.getClass(), SimpleIndexFactory.class);
  }
View Full Code Here

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

   * Test for void deleteDocument(int)
   */
  final public void testDeleteDocumentint() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.deleteDocument(0);
    indexReaderControl.setVoidCallable(1);
   
View Full Code Here

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

   * Test for void deleteDocument(Term)
   */
  final public void testDeleteDocumentTerm() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.deleteDocuments(new Term("field","lucene"));
    indexReaderControl.setReturnValue(1, 1);
   
View Full Code Here

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

  }

  final public void testUndeleteDocuments() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.undeleteAll();
    indexReaderControl.setVoidCallable(1);
   
View Full Code Here

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

  }

  final public void testIsDeleted() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.isDeleted(0);
    indexReaderControl.setReturnValue(true, 1);
   
View Full Code Here

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

  }

  final public void testHasDeletions() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.hasDeletions();
    indexReaderControl.setReturnValue(true, 1);
   
View Full Code Here

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

  }

  final public void testGetMaxDoc() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.maxDoc();
    indexReaderControl.setReturnValue(3, 1);
   
View Full Code Here

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

  }

  final public void testGetNumDocs() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();
    MockControl indexReaderControl = MockControl.createStrictControl(LuceneIndexReader.class);
    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.numDocs();
    indexReaderControl.setReturnValue(3, 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.