use of org.gradle.api.internal.file.FileResource in project gradle by gradle.
the class TarFileTreeTest method readsGzippedTarFile.
@Test
public void readsGzippedTarFile() {
TestFile tgz = tmpDir.getTestDirectory().file("test.tgz");
rootDir.file("subdir/file1.txt").write("content");
rootDir.file("subdir2/file2.txt").write("content");
rootDir.tgzTo(tgz);
TarFileTree tree = new TarFileTree(tarFile, new MaybeCompressedFileResource(new FileResource(tgz)), expandDir, fileSystem(), fileSystem(), directoryFileTreeFactory());
assertVisits(tree, toList("subdir/file1.txt", "subdir2/file2.txt"), toList("subdir", "subdir2"));
assertSetContainsForAllTypes(tree, toList("subdir/file1.txt", "subdir2/file2.txt"));
}
use of org.gradle.api.internal.file.FileResource in project gradle by gradle.
the class TarFileTreeTest method readsBzippedTarFile.
@Test
public void readsBzippedTarFile() {
TestFile tbz2 = tmpDir.getTestDirectory().file("test.tbz2");
rootDir.file("subdir/file1.txt").write("content");
rootDir.file("subdir2/file2.txt").write("content");
rootDir.tbzTo(tbz2);
TarFileTree tree = new TarFileTree(tarFile, new MaybeCompressedFileResource(new FileResource(tbz2)), expandDir, fileSystem(), fileSystem(), directoryFileTreeFactory());
assertVisits(tree, toList("subdir/file1.txt", "subdir2/file2.txt"), toList("subdir", "subdir2"));
assertSetContainsForAllTypes(tree, toList("subdir/file1.txt", "subdir2/file2.txt"));
}
Aggregations