|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.latka.AbstractReporter org.apache.commons.latka.XMLReporter
public class XMLReporter
This LatkaEventListener will generate an XML report
of all tests run during an Latka XML suite. XMLReporter
instances are NOT reusable for multiple invocations
of the Latka#runTests(Suite, LatkaEventInfo)
method.
Field Summary | |
---|---|
protected boolean |
_didSuiteSucceed
|
protected org.dom4j.Document |
_doc
dom4j document produced as output |
protected org.dom4j.DocumentFactory |
_factory
|
protected PrintWriter |
_printWriter
used for output as tests run |
protected org.dom4j.Element |
_rootElement
top level element of dom4j document, a <report> element |
Fields inherited from class org.apache.commons.latka.AbstractReporter |
---|
_log |
Constructor Summary | |
---|---|
XMLReporter()
Create an XML Reporter, initialising document property, as a new empty report with an unsuccessful suite |
Method Summary | |
---|---|
protected org.dom4j.Element |
createRequestElement(RequestEvent event)
Utility method that converts a RequestEvent object to its corresponding element in the dom4j object. |
org.dom4j.Document |
getDocument()
Returns the XML Document produced by this listener |
String |
getDocumentAsString()
Returns the test report converted from dom4j to a text string. |
void |
reportMessage(ReportMessageEvent event)
Add the message of the provided
event to the XML document as a <reportMessage> element with text |
void |
requestError(RequestEvent event)
Invoked if a request error occurs. |
void |
requestFailed(RequestEvent event)
Invoked if the request failed. |
void |
requestSkipped(RequestEvent event)
A skipped request. |
void |
requestSucceeded(RequestEvent event)
Invoked if the request succeeds |
void |
setPrintWriter(PrintWriter writer)
During the execution, any diagnostic ouput will be sent to the stream designated here. |
void |
suiteCompleted(SuiteEvent event)
Invoke when all requests completed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.dom4j.Document _doc
protected org.dom4j.Element _rootElement
protected PrintWriter _printWriter
protected boolean _didSuiteSucceed
protected org.dom4j.DocumentFactory _factory
Constructor Detail |
---|
public XMLReporter()
Method Detail |
---|
public org.dom4j.Document getDocument()
public String getDocumentAsString() throws IOException
IOException
- if the XML formatter cannot convert the dom4j object
to textpublic void requestError(RequestEvent event)
LatkaEventListener
requestError
in interface LatkaEventListener
event
- the event detailing the request in errorLatkaEventListener.requestError(RequestEvent)
public void requestSucceeded(RequestEvent event)
LatkaEventListener
requestSucceeded
in interface LatkaEventListener
event
- the event detailing the request that succeededLatkaEventListener.requestSucceeded(RequestEvent)
public void requestFailed(RequestEvent event)
LatkaEventListener
requestFailed
in interface LatkaEventListener
event
- the event detailing the request that failedLatkaEventListener.requestFailed(RequestEvent)
public void requestSkipped(RequestEvent event)
LatkaEventListener
requestSkipped
in interface LatkaEventListener
event
- the event detailing the request that was skippedLatkaEventListener.requestSkipped(RequestEvent)
public void reportMessage(ReportMessageEvent event)
message
of the provided
event to the XML document as a <reportMessage> element with text
reportMessage
in interface LatkaEventListener
event
- a ReportMessageEvent
public void suiteCompleted(SuiteEvent event)
LatkaEventListener
suiteCompleted
in interface LatkaEventListener
event
- the event detailing the completing SuiteLatkaEventListener.suiteCompleted(SuiteEvent)
protected org.dom4j.Element createRequestElement(RequestEvent event)
event
- the request event sent to the listener
public void setPrintWriter(PrintWriter writer)
writer
- PrintWriter that will receive output generated during
the test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |