org.apache.commons.latka
Class XMLReporter

java.lang.Object
  extended byorg.apache.commons.latka.AbstractReporter
      extended byorg.apache.commons.latka.XMLReporter
All Implemented Interfaces:
LatkaEventInfo, LatkaEventListener

public class XMLReporter
extends AbstractReporter

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.

Author:
Morgan Delagrange

Constructor Summary
XMLReporter()
           
 
Method Summary
 org.jdom.Document getDocument()
          Returns the XML Document produced by this listener
 java.lang.String getDocumentAsString()
          Returns the test report converted from JDOM to a text string.
 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.
 
Methods inherited from class org.apache.commons.latka.AbstractReporter
didRequestSucceed, didSessionSucceed, didSuiteSucceed, getFailedResponses
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReporter

public XMLReporter()
Method Detail

getDocument

public org.jdom.Document getDocument()
Returns the XML Document produced by this listener

Returns:
JDOM representation of the test report

getDocumentAsString

public java.lang.String getDocumentAsString()
                                     throws java.io.IOException
Returns the test report converted from JDOM to a text string.

Returns:
the test report as an XML string
Throws:
java.io.IOException - if the XML formatter cannot convert the JDOM object to text

requestError

public void requestError(RequestEvent event)
Description copied from interface: LatkaEventListener
Invoked if a request error occurs. A request "error" designates an inability to communicate with the target HTTP server (typically an IOException or a related exception).

Specified by:
requestError in interface LatkaEventListener
Overrides:
requestError in class AbstractReporter

requestFailed

public void requestFailed(RequestEvent event)
Description copied from interface: LatkaEventListener
Invoked if the request failed. A request "failure" is defined as a request that successfully received a reponse from the server, but that response failed validation (threw a ValidationException).

Specified by:
requestFailed in interface LatkaEventListener
Overrides:
requestFailed in class AbstractReporter

requestSkipped

public void requestSkipped(RequestEvent event)
Description copied from interface: LatkaEventListener
A skipped request. Most Latka suites will skip any further requests inside a session upon the first failed request.

Specified by:
requestSkipped in interface LatkaEventListener
Overrides:
requestSkipped in class AbstractReporter

requestSucceeded

public void requestSucceeded(RequestEvent event)
Description copied from interface: LatkaEventListener
Invoked if the request succeeds

Specified by:
requestSucceeded in interface LatkaEventListener
Overrides:
requestSucceeded in class AbstractReporter

setPrintWriter

public void setPrintWriter(java.io.PrintWriter writer)
During the execution, any diagnostic ouput will be sent to the stream designated here. If no PrintWriter is set, output will be sent to standard out.

Parameters:
writer - PrintWriter that will receive output generated during the test

suiteCompleted

public void suiteCompleted(SuiteEvent event)
Description copied from interface: LatkaEventListener
Invoke when all requests completed.

Parameters:
event - suite event


Copyright © 2001 Apache Software Foundation. Documenation generated September 27 2004.