Package org.apache.lucene.gdata.search.index.IndexController

Examples of org.apache.lucene.gdata.search.index.IndexController.ServiceIndex


     */
    public void testInitialize() {
        this.controller.initialize();
        assertTrue(this.controller.indexerMap
                .containsKey(ProvidedServiceStub.SERVICE_NAME));
        ServiceIndex bean = this.controller.indexerMap
                .get(ProvidedServiceStub.SERVICE_NAME);
        assertNotNull(bean);
        assertNotNull(bean.getIndexer());
        assertSame(this.schema, bean.getSchema());
        assertTrue(GDataServerRegistry.getRegistry().getEntryEventMediator()
                .isListenerRegistered(this.controller));

    }
View Full Code Here


        e.setId("someId");
        e.setFeedId("someId");
        e.setServiceConfig(new ProvidedServiceStub());
        CommitListener l = new CommitListener();
        l.createLatch(1);
        ServiceIndex sIndex = this.controller.indexerMap.get(this.schema.getName());
        sIndex.getIndexer().registerIndexEventListener(l);
        this.controller.fireInsertEvent(e);
        l.waitOnLatch();     
      
       assertEquals(1,sIndex.getIndexer().optimized.get());
       assertEquals(1,sIndex.getIndexer().committed.get());
      
       sIndex.getIndexer().removeIndexEventListener(l);
      
      
       e = new ServerBaseEntry();
       e.setId("someId");
       e.setFeedId("someId");
       e.setServiceConfig(new ProvidedServiceStub());
       l = new CommitListener();
       l.createLatch(1);
        sIndex = this.controller.indexerMap.get(this.schema.getName());
       sIndex.getIndexer().registerIndexEventListener(l);
       this.controller.fireUpdateEvent(e);
       l.waitOnLatch();     
     
      assertEquals(2,sIndex.getIndexer().optimized.get());
      assertEquals(2,sIndex.getIndexer().committed.get());
     
      GDataSearcher<String> searcher = this.controller.getServiceSearcher(e.getServiceConfig());
      List<String> results = searcher.search(new TermQuery(new Term(IndexDocument.FIELD_ENTRY_ID,"someId")),10,0,"someId");
      assertEquals(1,results.size());
      searcher.close();
View Full Code Here

TOP

Related Classes of org.apache.lucene.gdata.search.index.IndexController.ServiceIndex

Copyright © 2018 www.massapicom. 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.