use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.
the class FSLuceneSearcherProviderTest method resetsSearcherInProviderAfterClosingSearcher.
@Test
public void resetsSearcherInProviderAfterClosingSearcher() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
Searcher searcher = fsLuceneSearcherProvider.getSearcher(virtualFileSystem, true);
assertNotNull(searcher);
searcher.close();
assertNull(fsLuceneSearcherProvider.getSearcher(virtualFileSystem, false));
}
use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.
the class FSLuceneSearcherProviderTest method closesSearcherWhenProviderIsClosed.
@Test
public void closesSearcherWhenProviderIsClosed() throws Exception {
Searcher searcher = mock(Searcher.class);
fsLuceneSearcherProvider.searcherReference.set(searcher);
fsLuceneSearcherProvider.close();
verify(searcher).close();
}
use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.
the class FSLuceneSearcherProviderTest method returnsSameInstanceOfSearcherOnceItWasCreated.
@Test
public void returnsSameInstanceOfSearcherOnceItWasCreated() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
Searcher searcher = fsLuceneSearcherProvider.getSearcher(virtualFileSystem, true);
assertNotNull(searcher);
assertSame(searcher, fsLuceneSearcherProvider.getSearcher(virtualFileSystem, true));
}
use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.
the class MemoryLuceneSearcherProviderTest method closesSearcherWhenProviderIsClosed.
@Test
public void closesSearcherWhenProviderIsClosed() throws Exception {
Searcher searcher = mock(Searcher.class);
memoryLuceneSearcherProvider.searcherReference.set(searcher);
memoryLuceneSearcherProvider.close();
verify(searcher).close();
}
use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.
the class MemoryLuceneSearcherProviderTest method returnsSameInstanceOfSearcherOnceItWasCreated.
@Test
public void returnsSameInstanceOfSearcherOnceItWasCreated() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
Searcher searcher = memoryLuceneSearcherProvider.getSearcher(virtualFileSystem, true);
assertNotNull(searcher);
assertSame(searcher, memoryLuceneSearcherProvider.getSearcher(virtualFileSystem, false));
}
Aggregations