| org.archive.crawler.selftest.SelfTestCase
All known Subclasses: org.archive.crawler.selftest.CheckpointSelfTest, org.archive.crawler.selftest.AuthSelfTest, org.archive.crawler.selftest.CharsetSelfTest, org.archive.crawler.selftest.MaxLinkHopsSelfTest, org.archive.crawler.selftest.FramesSelfTestCase, org.archive.crawler.selftest.BadURIsStopPageParsingSelfTest, org.archive.crawler.selftest.BackgroundImageExtractionSelfTestCase, org.archive.crawler.selftest.FlashParseSelfTest,
SelfTestCase | abstract public class SelfTestCase extends TestCase (Code) | | Base class for integrated selftest unit tests.
Has utility for integrated selftest such as location of selftest generated
arc file.
author: stack version: $Id: SelfTestCase.java 4931 2007-02-21 18:48:17Z gojomo $ |
Field Summary | |
final protected static String | SELFTEST Suffix for selftest classes. |
Method Summary | |
protected static void | assertExists(File file) Test nonull and exits.
Parameters: file - File to test. | public void | assertInitialized() | protected static void | assertNonEmpty(String str) Test non null and not empty.
Parameters: str - String to test. | public boolean | fileExists(File file) Confirm passed file exists on disk under the test directory.
This method takes care of building up the file path under the selftest
webapp. | public boolean | filesExist(List files) Confirm passed files exist on disk under the test directory.
Parameters: files - Files to test for existence under the test's directory. | protected List<File> | filesFoundInArc() Find all files that belong to this test that are mentioned in the arc. | protected static File[] | getArcFiles() | public static CrawlJob | getCrawlJob() | protected static File | getCrawlJobDir() | public static File | getHtdocs() | protected static File | getLogsDir() | protected static List[] | getMetaDatas() | protected static ARCReader[] | getReadReaders() Returns the selftest read ARCReader.
The returned ARCReader has been validated. | public static String | getSelftestURL() | public static String | getSelftestURLWithTrailingSlash() Returns the selftestURL. | public String | getTestName() Calculates test name by stripping SelfTest from current class name. | public static synchronized void | initialize(String url, CrawlJob job, File jobDir, File docs) Static initializer.
Must be called before instantiation of any tests based off this class.
Parameters: url - URL to selftest webapp. Parameters: job - The selftest crawl job. Parameters: jobDir - Job output directory. | public void | testFilesInArc(List<File> files) Test passed list were all found in the arc.
If more or less found, test fails.
Parameters: files - List of files to find in the arc. | public void | testFilesInArc(List<File> files, List<File> foundFiles) Test passed list were all found in the arc.
If more or less found, test fails.
Parameters: files - List of files to find in the arc. | public void | testNothing() |
SELFTEST | final protected static String SELFTEST(Code) | | Suffix for selftest classes.
|
SelfTestCase | public SelfTestCase()(Code) | | |
assertExists | protected static void assertExists(File file)(Code) | | Test nonull and exits.
Parameters: file - File to test. Passed file. throws: FileNotFoundException - passed file doesn't exist. |
assertInitialized | public void assertInitialized()(Code) | | |
assertNonEmpty | protected static void assertNonEmpty(String str)(Code) | | Test non null and not empty.
Parameters: str - String to test. The passed string. throws: IllegalArgumentException - if null or empty string. |
fileExists | public boolean fileExists(File file)(Code) | | Confirm passed file exists on disk under the test directory.
This method takes care of building up the file path under the selftest
webapp. Just pass the file name.
Parameters: file - Name of file to look for. True if file exists. |
filesExist | public boolean filesExist(List files)(Code) | | Confirm passed files exist on disk under the test directory.
Parameters: files - Files to test for existence under the test's directory. true if all files exist on disk. |
filesFoundInArc | protected List<File> filesFoundInArc()(Code) | | Find all files that belong to this test that are mentioned in the arc.
List of unique found file File objects. |
getArcFiles | protected static File[] getArcFiles()(Code) | | Returns the arcDir. |
getCrawlJob | public static CrawlJob getCrawlJob()(Code) | | Returns the crawlJob. |
getCrawlJobDir | protected static File getCrawlJobDir()(Code) | | Returns the jobDir. |
getHtdocs | public static File getHtdocs()(Code) | | Returns the selftest webappDir. |
getLogsDir | protected static File getLogsDir()(Code) | | Return the directory w/ logs in it. |
getMetaDatas | protected static List[] getMetaDatas()(Code) | | Returns list of ARCReader metadatas, the byproduct of callingvalidate. |
getReadReaders | protected static ARCReader[] getReadReaders()(Code) | | Returns the selftest read ARCReader.
The returned ARCReader has been validated. Use it to get at metadata.
Returns the readReader, an ARCReader that has been validated. |
getSelftestURL | public static String getSelftestURL()(Code) | | Returns the selftestURL. |
getSelftestURLWithTrailingSlash | public static String getSelftestURLWithTrailingSlash()(Code) | | Returns the selftestURL. URL returned is guaranteed to havea trailing '/'. |
getTestName | public String getTestName()(Code) | | Calculates test name by stripping SelfTest from current class name.
The name of the test. |
testFilesInArc | public void testFilesInArc(List<File> files)(Code) | | Test passed list were all found in the arc.
If more or less found, test fails.
Parameters: files - List of files to find in the arc. No other files but theseshould be found in the arc. |
testFilesInArc | public void testFilesInArc(List<File> files, List<File> foundFiles)(Code) | | Test passed list were all found in the arc.
If more or less found, test fails.
Parameters: files - List of files to find in the arc. No other files but theseshould be found in the arc. Parameters: foundFiles - Files found in the arc. |
testNothing | public void testNothing()(Code) | | |
|
|