private Xpp3Dom getTestProblems( WrappedReportEntry report, boolean trimStackTrace, String reportNameSuffix )
{
Xpp3Dom testCase = createTestElement( report, reportNameSuffix );
Xpp3Dom element = createElement( testCase, report.getReportEntryType().name() );
String stackTrace = report.getStackTrace( trimStackTrace );
if ( report.getMessage() != null && report.getMessage().length() > 0 )
{
element.setAttribute( "message", report.getMessage() );
}
if ( report.getStackTraceWriter() != null )
{
//noinspection ThrowableResultOfMethodCallIgnored
SafeThrowable t = report.getStackTraceWriter().getThrowable();
if ( t != null )
{
if ( t.getMessage() != null )
{
element.setAttribute( "type", ( stackTrace.contains( ":" )
? stackTrace.substring( 0, stackTrace.indexOf( ":" ) )
: stackTrace ) );
}
else
{
element.setAttribute( "type", new StringTokenizer( stackTrace ).nextToken() );
}
}
}
if ( stackTrace != null )
{
element.setValue( stackTrace );
}
addOutputStreamElement( report.getStdout(), "system-out", testCase );
addOutputStreamElement( report.getStdErr(), "system-err", testCase );