* @param theTest the test object that failed
* @param theError the exception that was thrown
*/
public void addFailure(Test theTest, AssertionFailedError theError)
{
TestFailure failure = new TestFailure(theTest, theError);
StringBuffer xml = new StringBuffer();
xml.append("<" + FAILURE + " " + ATTR_MESSAGE + "=\""
+ xmlEncode(failure.thrownException().getMessage()) + "\" "
+ ATTR_TYPE + "=\""
+ failure.thrownException().getClass().getName() + "\">");
xml.append(xmlEncode(StringUtil.exceptionToString(
failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS)));
xml.append("</" + FAILURE + ">");
this.currentTestFailure = xml.toString();
}