Search in sources :

Example 1 with LocalVirtualFileSystem

use of org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem in project che by eclipse.

the class ZipArchiverTest method setUp.

@Before
public void setUp() throws Exception {
    File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
    testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
    assertTrue(testDirectory.mkdir());
    SearcherProvider searcherProvider = mock(SearcherProvider.class);
    Searcher searcher = mock(Searcher.class);
    VirtualFileSystem virtualFileSystem = new LocalVirtualFileSystem(testDirectory, mock(ArchiverFactory.class), searcherProvider, mock(AbstractVirtualFileSystemProvider.CloseCallback.class));
    when(searcherProvider.getSearcher(eq(virtualFileSystem), eq(true))).thenReturn(searcher);
    when(searcherProvider.getSearcher(eq(virtualFileSystem))).thenReturn(searcher);
    vfsRoot = virtualFileSystem.getRoot();
}
Also used : LocalVirtualFileSystem(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem) LocalVirtualFileSystem(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem) Searcher(org.eclipse.che.api.vfs.search.Searcher) File(java.io.File) SearcherProvider(org.eclipse.che.api.vfs.search.SearcherProvider) Before(org.junit.Before)

Example 2 with LocalVirtualFileSystem

use of org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem in project che by eclipse.

the class TarArchiverTest method setUp.

@Before
public void setUp() throws Exception {
    File targetDir = new File(Thread.currentThread().getContextClassLoader().getResource(".").getPath()).getParentFile();
    testDirectory = new File(targetDir, NameGenerator.generate("fs-", 4));
    assertTrue(testDirectory.mkdir());
    SearcherProvider searcherProvider = mock(SearcherProvider.class);
    Searcher searcher = mock(Searcher.class);
    VirtualFileSystem virtualFileSystem = new LocalVirtualFileSystem(testDirectory, mock(ArchiverFactory.class), searcherProvider, mock(AbstractVirtualFileSystemProvider.CloseCallback.class));
    when(searcherProvider.getSearcher(eq(virtualFileSystem), eq(true))).thenReturn(searcher);
    when(searcherProvider.getSearcher(eq(virtualFileSystem))).thenReturn(searcher);
    vfsRoot = virtualFileSystem.getRoot();
}
Also used : LocalVirtualFileSystem(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem) LocalVirtualFileSystem(org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem) Searcher(org.eclipse.che.api.vfs.search.Searcher) File(java.io.File) SearcherProvider(org.eclipse.che.api.vfs.search.SearcherProvider) Before(org.junit.Before)

Aggregations

File (java.io.File)2 LocalVirtualFileSystem (org.eclipse.che.api.vfs.impl.file.LocalVirtualFileSystem)2 Searcher (org.eclipse.che.api.vfs.search.Searcher)2 SearcherProvider (org.eclipse.che.api.vfs.search.SearcherProvider)2 Before (org.junit.Before)2