use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class LocalVirtualFileSystemProviderTest method closesVirtualFileSystemWhenProviderIsClosed.
@Test
public void closesVirtualFileSystemWhenProviderIsClosed() throws Exception {
AtomicReference<VirtualFileSystem> fileSystemReference = getFileSystemReference();
VirtualFileSystem fileSystem = mock(VirtualFileSystem.class);
fileSystemReference.set(fileSystem);
fileSystemProvider.close();
verify(fileSystem).close();
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class LocalVirtualFileSystemProviderTest method returnsSameInstanceOfVirtualFileSystemOnceItWasCreated.
@Test
public void returnsSameInstanceOfVirtualFileSystemOnceItWasCreated() throws Exception {
VirtualFileSystem fileSystem = fileSystemProvider.getVirtualFileSystem(true);
assertNotNull(fileSystem);
assertSame(fileSystem, fileSystemProvider.getVirtualFileSystem(false));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class FSLuceneSearcherProviderTest method doesNotCreateSearcherWhenItIsNotCreatedYetAndCreationIsNotRequested.
@Test
public void doesNotCreateSearcherWhenItIsNotCreatedYetAndCreationIsNotRequested() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
assertNull(fsLuceneSearcherProvider.getSearcher(virtualFileSystem, false));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class FSLuceneSearcherProviderTest method createsAndInitializeSearcherWhenCreationRequested.
@Test
public void createsAndInitializeSearcherWhenCreationRequested() throws Exception {
VirtualFileSystem virtualFileSystem = mockVirtualFileSystem();
assertNotNull(fsLuceneSearcherProvider.getSearcher(virtualFileSystem, true));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class FSLuceneSearcherProviderTest method mockVirtualFileSystem.
private VirtualFileSystem mockVirtualFileSystem() {
VirtualFileSystem virtualFileSystem = mock(VirtualFileSystem.class);
VirtualFile root = mock(VirtualFile.class);
when(virtualFileSystem.getRoot()).thenReturn(root);
return virtualFileSystem;
}
Aggregations