|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSearchTest
CDLSearchTest
public class CDLSearchTest
CDL-specific test: searches for every chunk of every document in an index.
Field Summary | |
---|---|
private String |
debugDoc
|
private int |
debugNum
|
private String |
searchTerm
|
private static String |
server
|
private boolean |
skipping
|
private String |
skipToDoc
|
private int |
totalUrls
|
private static String |
urlPrefix
|
private int |
urlsDone
|
Fields inherited from class SearchTest |
---|
baseDir, dynaXML |
Constructor Summary | |
---|---|
CDLSearchTest(String baseDir)
Default constructor |
Method Summary | |
---|---|
private String |
docIdFromPath(String path)
Parses out the document ID given a document's path. |
private String[] |
getDocs(String indexPath,
String sourcePath)
Scans an index for all the documents present in it, and returns their paths. |
static void |
main(String[] args)
Runs the test. |
private String |
normalizeResult(String result)
Transforms parts of the text that are okay to mismatch into matching text. |
private void |
pushUrl(HashSet processedUrls,
String url,
LinkedList urlStack)
If the URL hasn't been processed yet, it is added to the LinkedList. |
private void |
pushUrls(HashSet processedUrls,
String htmlResult,
LinkedList urlStack)
Scans the HTML result and adds all relevant URLs that haven't already been processed to the urlStack. |
void |
runTest(String indexPath,
String sourcePath)
Actual controlling routine that manages the test through its various stages. |
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 |
testDoc(String docPath)
Runs the test for a single document. |
Methods inherited from class SearchTest |
---|
randomizeArray, runDynaXML |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String server
private static final String urlPrefix
private int totalUrls
private int urlsDone
private final String searchTerm
private String skipToDoc
private boolean skipping
private String debugDoc
private int debugNum
Constructor Detail |
---|
public CDLSearchTest(String baseDir) throws ServletException
baseDir
- The normal base directory used for DynaXML
ServletException
Method Detail |
---|
private String docIdFromPath(String path)
path
- Path to the document
private String[] getDocs(String indexPath, String sourcePath) throws IOException
IOException
private void pushUrl(HashSet processedUrls, String url, LinkedList urlStack)
processedUrls
- Set of all processed URLs so farurl
- URL to pushurlStack
- LinkedList to add toprivate void pushUrls(HashSet processedUrls, String htmlResult, LinkedList urlStack)
processedUrls
- Set of URLs which have already been processedhtmlResult
- HTML to scanurlStack
- LinkedList to add toprivate String normalizeResult(String result)
String[] slurp(String str)
str
- String to break up
private boolean sameResults(String result1, String result2)
result1
- First stringresult2
- Second string
private void testDoc(String docPath) throws Exception
docPath
- File path of the document to test
Exception
public void runTest(String indexPath, String sourcePath) throws Exception
Exception
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |