public abstract class AbstractTestCase extends junit.framework.TestCase
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
archiveList |
protected File |
dir |
protected ArchiveStreamFactory |
factory |
protected File |
resultDir |
| Constructor and Description |
|---|
AbstractTestCase() |
AbstractTestCase(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkArchiveContent(ArchiveInputStream in,
List<String> expected)
Checks that an archive input stream can be read, and that the file data matches file sizes.
|
protected File |
checkArchiveContent(ArchiveInputStream in,
List<String> expected,
boolean cleanUp)
Checks that an archive input stream can be read, and that the file data matches file sizes.
|
protected void |
checkArchiveContent(File archive,
List<String> expected)
Checks if an archive contains all expected files.
|
protected void |
closeQuietly(Closeable closeable) |
protected File |
createArchive(String archivename)
Creates an archive of textbased files in several directories.
|
protected File |
createEmptyArchive(String archivename)
Create an empty archive.
|
protected File |
createSingleEntryArchive(String archivename)
Create an archive with a single file "test1.xml".
|
protected File[] |
createTempDirAndFile()
Creates a temporary directory and a temporary file inside that
directory, returns both of them (the directory is the first
element of the two element array).
|
protected String |
getExpectedString(ArchiveEntry entry)
Override this method to change what is to be compared in the List.
|
static File |
getFile(String path) |
static File |
mkdir(String name) |
static void |
rmdir(File f) |
protected void |
setUp() |
protected void |
tearDown() |
static boolean |
tryHardToDelete(File f)
Accommodate Windows bug encountered in both Sun and IBM JDKs.
|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toStringprotected List<String> archiveList
protected ArchiveStreamFactory factory
public AbstractTestCase()
public AbstractTestCase(String name)
protected void setUp() throws Exception
setUp in class junit.framework.TestCaseExceptionpublic static File mkdir(String name) throws IOException
IOExceptionpublic static File getFile(String path) throws IOException
IOExceptionprotected void tearDown() throws Exception
tearDown in class junit.framework.TestCaseExceptionpublic static boolean tryHardToDelete(File f)
protected File createArchive(String archivename) throws Exception
archivename - the identifier of this archiveException - in case something goes wrongprotected File createEmptyArchive(String archivename) throws Exception
archivename - Exceptionprotected File createSingleEntryArchive(String archivename) throws Exception
archivename - Exceptionprotected void checkArchiveContent(File archive, List<String> expected) throws Exception
archive - the archive to checkexpected - a list with expected string filenamesExceptionprotected void checkArchiveContent(ArchiveInputStream in, List<String> expected) throws Exception
in - expected - list of expected entries or null if no check of names desiredExceptionprotected File checkArchiveContent(ArchiveInputStream in, List<String> expected, boolean cleanUp) throws Exception
in - expected - list of expected entries or null if no check of names desiredcleanUp - Cleans up resources if trueExceptionprotected String getExpectedString(ArchiveEntry entry)
entry - protected File[] createTempDirAndFile() throws IOException
IOExceptionprotected void closeQuietly(Closeable closeable)
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.