public class XMLReporter extends AbstractReporter implements LatkaEventListener
Latka#runTests(Suite, LatkaEventInfo)
method.Modifier and Type | Field and Description |
---|---|
protected boolean |
_didSuiteSucceed |
protected org.dom4j.Document |
_doc
dom4j document produced as output
|
protected org.dom4j.DocumentFactory |
_factory |
protected java.io.PrintWriter |
_printWriter
used for output as tests run
|
protected org.dom4j.Element |
_rootElement
top level element of dom4j document, a <report> element
|
_log
Constructor and Description |
---|
XMLReporter()
Create an XML Reporter, initialising document property, as a new empty
report with an unsuccessful suite
|
Modifier and Type | Method and Description |
---|---|
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
|
java.lang.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(java.io.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.
|
protected org.dom4j.Document _doc
protected org.dom4j.Element _rootElement
protected java.io.PrintWriter _printWriter
protected boolean _didSuiteSucceed
protected org.dom4j.DocumentFactory _factory
public XMLReporter()
public org.dom4j.Document getDocument()
public java.lang.String getDocumentAsString() throws java.io.IOException
java.io.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 textreportMessage
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 listenerpublic void setPrintWriter(java.io.PrintWriter writer)
writer
- PrintWriter that will receive output generated during
the testCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.