tests: log failure to better correlate where it happened

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1022998 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-10-15 16:25:30 +00:00
parent 3422c9e2d8
commit 612a6ceaac
1 changed files with 7 additions and 3 deletions

View File

@ -328,14 +328,18 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
String results = h.validateXPath(response, tests);
if (null != results) {
fail(m + "query failed XPath: " + results +
"\n xml response was: " + response +
"\n request was: " + req.getParamString());
String msg = "REQUEST FAILED: xpath=" + results
+ "\n\txml response was: " + response
+ "\n\trequest was:" + req.getParamString();
log.error(msg);
throw new RuntimeException(msg);
}
} catch (XPathExpressionException e1) {
throw new RuntimeException("XPath is invalid", e1);
} catch (Exception e2) {
log.error("REQUEST FAILED: " + req.getParamString());
throw new RuntimeException("Exception during query", e2);
}
}