use of org.eclipse.che.api.vfs.Archiver in project che by eclipse.
the class MemoryVirtualFileTest method unzipsInFolder.
@Test
public void unzipsInFolder() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("zip"))).thenReturn(archiver);
folder.unzip(new ByteArrayInputStream(new byte[0]), false, 0);
verify(archiver).extract(any(InputStream.class), eq(false), eq(0));
}
use of org.eclipse.che.api.vfs.Archiver in project che by eclipse.
the class MemoryVirtualFileTest method compressesFolderToZipArchive.
@Test
public void compressesFolderToZipArchive() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("zip"))).thenReturn(archiver);
folder.zip();
verify(archiver).compress(any(OutputStream.class));
}
Aggregations