bb.io
Class ZipUtil.UnitTest
java.lang.Object
bb.io.ZipUtil.UnitTest
- Enclosing class:
- ZipUtil
public static class ZipUtil.UnitTest
- extends Object
See the Overview page of the project's javadocs for a general description of this unit test class.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
private static final File root
id
private static final AtomicLong id
ZipUtil.UnitTest
public ZipUtil.UnitTest()
makeDataFile
static File makeDataFile(File parent,
long length)
throws IllegalArgumentException,
IOException
- Result is always a temporary file of the specified length (its data consists of the Latin alphabet continuously repeated).
Its name includes an ID number as well as its length in bytes, which makes it unique (for this JVM session).
- Throws:
IllegalArgumentException
IOException
makeArchiveFile
static File makeArchiveFile(String type)
- Result is always a temporary file that initially contains no data.
Its name includes an ID number, which makes it unique (for this JVM session).
makeDirectory
static File makeDirectory(String namePrefix)
- Result is always a directory located inside
root
, with the specified name,
that does not currently exist (hence, contains no data).
Its name starts with namePrefix, and is then followed by "Dir#"
and then an ID number, which makes it unique (for this JVM session).
test_archive_extract
public void test_archive_extract()
throws Exception
- Throws:
Exception
archive_extract
private void archive_extract(File dirToArchive,
String type)
throws Exception
- Throws:
Exception
confirmExtraction
private void confirmExtraction(File dirToArchive,
File directoryExtraction)
throws Exception
- Throws:
Exception
extractWithDifferentProgram
private void extractWithDifferentProgram(File zipFile,
File directoryExtraction)
throws Exception
- Throws:
Exception
unZipCommand
private String unZipCommand(File zipFile)
throws Exception
- Throws:
Exception
archiveWithDifferentProgram
private void archiveWithDifferentProgram(File dirToArchive,
File zipFile)
throws Exception
- Throws:
Exception
zipCommand
private String zipCommand(File dirToArchive,
File zipFile)
throws Exception
- Throws:
Exception
test_archive_extract_fileSizeLimit_shouldPass
public void test_archive_extract_fileSizeLimit_shouldPass()
throws Exception
- Throws:
Exception
test_archive_extract_fileSizeLimit_shouldFail
public void test_archive_extract_fileSizeLimit_shouldFail()
throws Exception
- Throws:
Exception
printEntries
private static void printEntries(File zipFile)
throws Exception
- Throws:
Exception