protected String generateResultXml ( String testName , Throwable exception , double executionTime ) { int errors = 0 ; int failures = 0 ; String failureXml = "" ; if ( exception != null ) { failureXml = "<failure type=\"" + exception . getClass ( ) . getName ( ) + "\" message=\"" + getMessage ( exception ) + "\"></failure>" ; if ( exception instanceof AssertionError ) failures = 1 ; else errors = 1 ; } return "<testsuite errors=\"" + errors + "\" skipped=\"0\" tests=\"1\" time=\"" + executionTime + "\" failures=\"" + failures + "\" name=\"" + testName + "\">" + "<properties></properties>" + "<testcase classname=\"" + testName + "\" time=\"" + executionTime + "\" name=\"" + testName + "\">" + failureXml + "</testcase>" + "</testsuite>" ; }
Creates XML string describing test outcome .