Search in sources :

Example 1 with MockEngineFactory

use of org.elasticsearch.test.engine.MockEngineFactory in project elasticsearch by elastic.

the class IndexModuleTests method testWrapperIsBound.

public void testWrapperIsBound() throws IOException {
    IndexModule module = new IndexModule(indexSettings, new AnalysisRegistry(environment, emptyMap(), emptyMap(), emptyMap(), emptyMap(), emptyMap()));
    module.setSearcherWrapper((s) -> new Wrapper());
    module.engineFactory.set(new MockEngineFactory(AssertingDirectoryReader.class));
    IndexService indexService = newIndexService(module);
    assertTrue(indexService.getSearcherWrapper() instanceof Wrapper);
    assertSame(indexService.getEngineFactory(), module.engineFactory.get());
    indexService.close("simon says", false);
}
Also used : AnalysisRegistry(org.elasticsearch.index.analysis.AnalysisRegistry) IndexSearcherWrapper(org.elasticsearch.index.shard.IndexSearcherWrapper) MockEngineFactory(org.elasticsearch.test.engine.MockEngineFactory) AssertingDirectoryReader(org.apache.lucene.index.AssertingDirectoryReader)

Aggregations

AssertingDirectoryReader (org.apache.lucene.index.AssertingDirectoryReader)1 AnalysisRegistry (org.elasticsearch.index.analysis.AnalysisRegistry)1 IndexSearcherWrapper (org.elasticsearch.index.shard.IndexSearcherWrapper)1 MockEngineFactory (org.elasticsearch.test.engine.MockEngineFactory)1