use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class MemoryLuceneSearcherProviderTest method createsAndInitializeSearcherWhenCreationRequested.
@Test
public void createsAndInitializeSearcherWhenCreationRequested() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
assertNotNull(memoryLuceneSearcherProvider.getSearcher(virtualFileSystem, true));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class MemoryLuceneSearcherProviderTest method resetsSearcherInProviderAfterClosingSearcher.
@Test
public void resetsSearcherInProviderAfterClosingSearcher() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
Searcher searcher = memoryLuceneSearcherProvider.getSearcher(virtualFileSystem, true);
assertNotNull(searcher);
searcher.close();
assertNull(memoryLuceneSearcherProvider.getSearcher(virtualFileSystem, false));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class MemoryLuceneSearcherProviderTest method mockVirtualFileSystem.
private VirtualFileSystem mockVirtualFileSystem() {
VirtualFileSystem virtualFileSystem = mock(VirtualFileSystem.class);
VirtualFile root = mock(VirtualFile.class);
when(virtualFileSystem.getRoot()).thenReturn(root);
return virtualFileSystem;
}
Aggregations