|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.sca.host.webapp.junit.XMLFormatter
public class XMLFormatter
Format the test results in XML.
Field Summary | |
---|---|
static java.lang.String |
ATTR_ERRORS
Errors attribute for TestSuite elements |
static java.lang.String |
ATTR_FAILURES
Failures attribute for TestSuite elements |
static java.lang.String |
ATTR_MESSAGE
Message attribute for failure elements (message of the exception) |
static java.lang.String |
ATTR_NAME
Name attribute for property, TestCase and TestSuite elements |
static java.lang.String |
ATTR_TESTS
Tests attribute for TestSuite elements (number of tests executed) |
static java.lang.String |
ATTR_TIME
Time attribute for TestCase and TestSuite elements |
static java.lang.String |
ATTR_TYPE
Type attribute for failure and error elements |
static java.lang.String |
ERROR
The error element (for a test case) |
static java.lang.String |
FAILURE
The failure element (for a test case) |
static java.lang.String |
TESTCASE
A single TestCase element |
static java.lang.String |
TESTSUITE
A single test suite results. |
Constructor Summary | |
---|---|
XMLFormatter()
|
Method Summary | |
---|---|
static java.lang.String |
escape(java.lang.String theString)
Escapes reserved XML characters. |
static java.lang.String |
exceptionToString(java.lang.Throwable theThrowable)
Returns the stack trace of an exception as String. |
static java.lang.String |
exceptionToString(java.lang.Throwable theThrowable,
java.lang.String[] theFilterPatterns)
Returns the stack trace of an exception as String, optionally filtering out line from the stack trace |
static boolean |
filterLine(java.lang.String theLine,
java.lang.String[] theFilterPatterns)
|
static java.lang.String |
getDurationAsString(long theDuration)
Convert a duration expressed as a long into a string. |
static java.lang.String |
toXML(Failure failure)
|
static java.lang.String |
toXML(Result result,
java.lang.Class<?> cls)
Formats the test result as an XML string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTR_ERRORS
public static final java.lang.String ATTR_FAILURES
public static final java.lang.String ATTR_MESSAGE
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_TESTS
public static final java.lang.String ATTR_TIME
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ERROR
public static final java.lang.String FAILURE
public static final java.lang.String TESTCASE
public static final java.lang.String TESTSUITE
Constructor Detail |
---|
public XMLFormatter()
Method Detail |
---|
public static java.lang.String escape(java.lang.String theString)
theString
- the string to escape
public static java.lang.String exceptionToString(java.lang.Throwable theThrowable)
theThrowable
- the exception from which to extract the stack trace
as a String
public static java.lang.String exceptionToString(java.lang.Throwable theThrowable, java.lang.String[] theFilterPatterns)
theThrowable
- the exception from which to extract the stack trace
as a StringtheFilterPatterns
- Array containing a list of patterns to filter
out from the stack trace
public static boolean filterLine(java.lang.String theLine, java.lang.String[] theFilterPatterns)
theLine
- The line to checktheFilterPatterns
- The patterns to filter out
public static java.lang.String getDurationAsString(long theDuration)
theDuration
- the duration to convert to string
public static java.lang.String toXML(Failure failure)
public static java.lang.String toXML(Result result, java.lang.Class<?> cls)
result
- the test result object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |