|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.archive.crawler.selftest.SelfTestCase
public abstract class SelfTestCase
Base class for integrated selftest unit tests. Has utility for integrated selftest such as location of selftest generated arc file.
Field Summary | |
---|---|
protected static java.lang.String |
SELFTEST
Suffix for selftest classes. |
Constructor Summary | |
---|---|
SelfTestCase()
|
|
SelfTestCase(java.lang.String testName)
|
Method Summary | |
---|---|
protected static void |
assertExists(java.io.File file)
Test nonull and exits. |
void |
assertInitialized()
|
protected static void |
assertNonEmpty(java.lang.String str)
Test non null and not empty. |
boolean |
fileExists(java.io.File file)
Confirm passed file exists on disk under the test directory. |
boolean |
filesExist(java.util.List files)
Confirm passed files exist on disk under the test directory. |
protected java.util.List<java.io.File> |
filesFoundInArc()
Find all files that belong to this test that are mentioned in the arc. |
protected static java.io.File[] |
getArcFiles()
|
static CrawlJob |
getCrawlJob()
|
protected static java.io.File |
getCrawlJobDir()
|
static java.io.File |
getHtdocs()
|
protected static java.io.File |
getLogsDir()
|
protected static java.util.List[] |
getMetaDatas()
|
protected static ARCReader[] |
getReadReaders()
Returns the selftest read ARCReader. |
static java.lang.String |
getSelftestURL()
|
static java.lang.String |
getSelftestURLWithTrailingSlash()
|
java.lang.String |
getTestName()
Calculates test name by stripping SelfTest from current class name. |
static void |
initialize(java.lang.String url,
CrawlJob job,
java.io.File jobDir,
java.io.File docs)
Static initializer. |
void |
testFilesInArc(java.util.List<java.io.File> files)
Test passed list were all found in the arc. |
void |
testFilesInArc(java.util.List<java.io.File> files,
java.util.List<java.io.File> foundFiles)
Test passed list were all found in the arc. |
void |
testNothing()
|
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
---|
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, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String SELFTEST
Constructor Detail |
---|
public SelfTestCase()
public SelfTestCase(java.lang.String testName)
Method Detail |
---|
public void testNothing()
public void assertInitialized()
protected static void assertNonEmpty(java.lang.String str)
str
- String to test.
java.lang.IllegalArgumentException
- if null or empty string.protected static void assertExists(java.io.File file)
file
- File to test.
java.io.FileNotFoundException
- passed file doesn't exist.public static void initialize(java.lang.String url, CrawlJob job, java.io.File jobDir, java.io.File docs) throws java.io.IOException, javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException, java.lang.InterruptedException
url
- URL to selftest webapp.job
- The selftest crawl job.jobDir
- Job output directory. Has the seed file, the order file
and logs.docs
- Expanded webapp directory location.
java.io.IOException
- if nonexistent directories passed.
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
java.lang.InterruptedException
protected static java.io.File[] getArcFiles()
protected static java.io.File getCrawlJobDir()
protected static java.io.File getLogsDir()
protected static ARCReader[] getReadReaders()
protected static java.util.List[] getMetaDatas()
public static java.lang.String getSelftestURL()
public static java.lang.String getSelftestURLWithTrailingSlash()
public java.lang.String getTestName()
public static java.io.File getHtdocs()
public static CrawlJob getCrawlJob()
public boolean filesExist(java.util.List files)
files
- Files to test for existence under the test's directory.
public boolean fileExists(java.io.File file)
file
- Name of file to look for.
public void testFilesInArc(java.util.List<java.io.File> files)
files
- List of files to find in the arc. No other files but these
should be found in the arc.public void testFilesInArc(java.util.List<java.io.File> files, java.util.List<java.io.File> foundFiles)
files
- List of files to find in the arc. No other files but these
should be found in the arc.foundFiles
- Files found in the arc.protected java.util.List<java.io.File> filesFoundInArc()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |