You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I designed a custom class A implemented the class TestSystemListener , I can't get the stack trace of an exception in the override method testExceptionOccurred, my code is as follows:
@OverridepublicvoidtestExceptionOccurred(Assertionassertion, ExceptionResultexceptionResult) {
// TODO Auto-generated method stubStringmessage = (exceptionResult.getMessage()==null)?"":exceptionResult.getMessage();
// xmlnode is an instance of class org.w3c.dom.Elementxmlnode.setAttribute(ATTR_MESSAGE, message);
}
the variable message is always empty when executing some test case with exception, also methods getActual() and getExpected() of class TestResult return null, I suppose they can return some useful information, exceptionResult.getMessage() returns the stack trace and the previous 2 calls return the expectation and actual result in the test, is it a bug of Fitnesse?
Can you help me with these issues?
Thanks.
The text was updated successfully, but these errors were encountered:
Hi Liu,
I think I had the same or similar problem and fixed it in PR #1131 for the standard HTML output.
See https://github.com/unclebob/fitnesse/pull/1131/files
In file src/fitnesse/testsystems/slim/HtmlTable.java
New line number 374 ...
exceptionResult.getException()
If I remember correctly either exceptionResult or TestResult are populated but not both.
So if you have an exception the methods getActual() and getExpected() have no defined values.
Hope this helpes.
I fixed it, I converted the instance of class ExceptionResult to that of class SlimExceptionResult and invoked the method getException() on it, it returned the stack trace successfully.
Hi,
I designed a custom class A implemented the class TestSystemListener , I can't get the stack trace of an exception in the override method testExceptionOccurred, my code is as follows:
the variable message is always empty when executing some test case with exception, also methods getActual() and getExpected() of class TestResult return null, I suppose they can return some useful information, exceptionResult.getMessage() returns the stack trace and the previous 2 calls return the expectation and actual result in the test, is it a bug of Fitnesse?
Can you help me with these issues?
Thanks.
The text was updated successfully, but these errors were encountered: