*
* @param theResult Result to check
*/
public void checkResult(Result theResult) throws Exception {
assertNotNull("Parameter theResult is null", theResult);
ResourceSet aResourceSet = theResult.getResourceSet();
assertNotNull("theResult contains a null ResourceSet", aResourceSet);
if (itsExpectedResourceCount >= 0) {
assertEquals("Result did not contain expected number of resources",
itsExpectedResourceCount, aResourceSet.getSize());
}
if (itsExpectedResources != null && itsExpectedResources.length > 1) {
for (int anIndex = 0; anIndex < itsExpectedResources.length / 2; anIndex += 2) {
XMLResource aResource = (XMLResource) aResourceSet.getResource(anIndex);
Node aNode = aResource.getContentAsDOM();
int anExpectedSourceDocumentIndex = ((Integer) itsExpectedResources[anIndex]).intValue();
String anExpected = "<?xml version=\"1.0\"?>\n" + addSource((String) itsExpectedResources[anIndex + 1],
TEST_DOCUMENT_PREFIX + anIndex,
IndexedSearchTest.INDEXED_SEARCH_TEST_COLLECTION_PATH);