use of org.eclipse.che.api.vfs.Archiver in project che by eclipse.
the class LocalVirtualFileTest 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), any(VirtualFileFilter.class));
}
use of org.eclipse.che.api.vfs.Archiver in project che by eclipse.
the class LocalVirtualFileTest method untarsInFolder.
@Test
public void untarsInFolder() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("tar"))).thenReturn(archiver);
folder.untar(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 addFolderInSearcherAfterExtractTarArchive.
@Test
public void addFolderInSearcherAfterExtractTarArchive() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Mockito.reset(searcher);
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("tar"))).thenReturn(archiver);
folder.untar(new ByteArrayInputStream(new byte[0]), false, 0);
verify(searcher).add(folder);
}
use of org.eclipse.che.api.vfs.Archiver in project che by eclipse.
the class MemoryVirtualFileTest method untarsInFolder.
@Test
public void untarsInFolder() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("tar"))).thenReturn(archiver);
folder.untar(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 compressFolderToTarArchive.
@Test
public void compressFolderToTarArchive() throws Exception {
VirtualFile folder = getRoot().createFolder(generateFolderName());
Archiver archiver = mock(Archiver.class);
when(archiverFactory.createArchiver(eq(folder), eq("tar"))).thenReturn(archiver);
folder.tar();
verify(archiver).compress(any(OutputStream.class));
}
Aggregations