Search in sources :

Example 16 with Searcher

use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.

the class MemoryVirtualFileSystemTest method setUp.

@Before
public void setUp() throws Exception {
    SearcherProvider searcherProvider = mock(SearcherProvider.class);
    searcher = mock(Searcher.class);
    closeCallback = mock(AbstractVirtualFileSystemProvider.CloseCallback.class);
    fileSystem = new MemoryVirtualFileSystem(mock(ArchiverFactory.class), searcherProvider, closeCallback);
    when(searcherProvider.getSearcher(eq(fileSystem), anyBoolean())).thenReturn(searcher);
}
Also used : Searcher(org.eclipse.che.api.vfs.search.Searcher) SearcherProvider(org.eclipse.che.api.vfs.search.SearcherProvider) Before(org.junit.Before)

Example 17 with Searcher

use of org.eclipse.che.api.vfs.search.Searcher 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));
}
Also used : VirtualFileSystem(org.eclipse.che.api.vfs.VirtualFileSystem) Searcher(org.eclipse.che.api.vfs.search.Searcher) Test(org.junit.Test)

Example 18 with Searcher

use of org.eclipse.che.api.vfs.search.Searcher in project che by eclipse.

the class MemoryVirtualFileTest method setUp.

@Before
public void setUp() throws Exception {
    archiverFactory = mock(ArchiverFactory.class);
    SearcherProvider searcherProvider = mock(SearcherProvider.class);
    fileSystem = new MemoryVirtualFileSystem(archiverFactory, searcherProvider);
    searcher = mock(Searcher.class);
    when(searcherProvider.getSearcher(eq(fileSystem), eq(true))).thenReturn(searcher);
    when(searcherProvider.getSearcher(eq(fileSystem))).thenReturn(searcher);
}
Also used : Searcher(org.eclipse.che.api.vfs.search.Searcher) ArchiverFactory(org.eclipse.che.api.vfs.ArchiverFactory) SearcherProvider(org.eclipse.che.api.vfs.search.SearcherProvider) Before(org.junit.Before)

Aggregations

Searcher (org.eclipse.che.api.vfs.search.Searcher)18 SearcherProvider (org.eclipse.che.api.vfs.search.SearcherProvider)9 VirtualFileSystem (org.eclipse.che.api.vfs.VirtualFileSystem)7 Before (org.junit.Before)6 Test (org.junit.Test)6 File (java.io.File)4 Path (java.nio.file.Path)3 ServerException (org.eclipse.che.api.core.ServerException)3 VirtualFile (org.eclipse.che.api.vfs.VirtualFile)3 ArchiverFactory (org.eclipse.che.api.vfs.ArchiverFactory)2 LocalVirtualFileSystem (org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 ArrayList (java.util.ArrayList)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 ConflictException (org.eclipse.che.api.core.ConflictException)1 NotFoundException (org.eclipse.che.api.core.NotFoundException)1 ItemReference (org.eclipse.che.api.project.shared.dto.ItemReference)1