public class RegressTest
extends Object
Modifier and Type | Field and Description |
---|---|
(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 and Description |
---|
RegressTest() |
Modifier and Type | Method and Description |
---|---|
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
|
int nRun
int nSucceeded
String baseDir
File filterDir
File filterFile
LinkedList failedTests
static Configuration config
StylesheetCache stylesheetCache
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 stylesheetException
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 stylesheetException
String[] slurp(String str)
str
- String to break upprivate boolean sameResults(String result1, String result2)
result1
- First stringresult2
- Second stringprivate boolean filesEqual(File file1, File file2) throws IOException
IOException
private String readFile(File file) throws IOException
IOException