|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectRegressTest
public class RegressTest
Runs a series of regression tests. These take a set of test files and index
them, then run queries and check the results.
The test scans subdirectories of the directory it's started in, looking
for:
Field Summary | |
---|---|
(package private) String |
baseDir
|
(package private) static Configuration |
config
|
(package private) LinkedList |
failedTests
|
(package private) File |
filterDir
|
(package private) File |
filterFile
|
(package private) int |
nRun
|
(package private) int |
nSucceeded
|
(package private) StylesheetCache |
stylesheetCache
|
Constructor Summary | |
---|---|
RegressTest()
|
Method Summary | |
---|---|
private String |
chopPath(String in)
|
private boolean |
filesEqual(File file1,
File file2)
|
protected void |
formatHits(File outFile,
QueryResult result,
String displayStyle)
Formats a list of hits using the resultFormatter stylesheet. |
protected void |
formatTree(File outFile,
SearchTree tree,
PreparedStylesheet displaySheet)
Formats a search tree with a stylesheet, and writes it to the output file. |
private String |
formPath(String path,
String sub)
|
private void |
index(File configFile)
Runs a configuration file to produce an index. |
static void |
main(String[] args)
|
private void |
processDir(File curFile,
LinkedList inFiles)
|
private String |
readFile(File file)
|
void |
run(String[] args)
|
private void |
runTest(File inFile)
|
private void |
runTests(LinkedList inFiles)
|
private boolean |
sameResults(String result1,
String result2)
Compares two strings for equality. |
(package private) String[] |
slurp(String str)
Breaks up a string by newlines into an array of strings, one per line. |
private void |
writeHits(File outFile,
QueryResult result)
Writes the hits in a very simple format to the output file |
private void |
writeTree(File outFile,
SearchTree tree)
Writes the search tree to a file |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int nRun
int nSucceeded
String baseDir
File filterDir
File filterFile
LinkedList failedTests
static Configuration config
StylesheetCache stylesheetCache
Constructor Detail |
---|
public RegressTest()
Method Detail |
---|
public static void main(String[] args)
public void run(String[] args)
private void processDir(File curFile, LinkedList inFiles) throws IOException
IOException
private void index(File configFile) throws IOException
configFile
- Path to the config file.
IOException
private void runTests(LinkedList inFiles) throws IOException
IOException
private String chopPath(String in)
private void runTest(File inFile) throws IOException
IOException
private String formPath(String path, String sub)
private void writeHits(File outFile, QueryResult result) throws IOException
IOException
protected void formatHits(File outFile, QueryResult result, String displayStyle) throws Exception
outFile
- Where to write the results.result
- Hits resulting from the query requestdisplayStyle
- Path of the resultFormatter stylesheet
Exception
private void writeTree(File outFile, SearchTree tree) throws IOException
IOException
protected void formatTree(File outFile, SearchTree tree, PreparedStylesheet displaySheet) throws Exception
outFile
- Where to write the results.tree
- Tree to output fromdisplaySheet
- The resultFormatter stylesheet
Exception
String[] slurp(String str)
str
- String to break up
private boolean sameResults(String result1, String result2)
result1
- First stringresult2
- Second string
private boolean filesEqual(File file1, File file2) throws IOException
IOException
private String readFile(File file) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |