com.googlecode.lightest.core
Class XMLSuiteResultWriter

java.lang.Object
  extended by com.googlecode.lightest.core.XMLSuiteResultWriter
Direct Known Subclasses:
LightestSuiteResultWriter

public class XMLSuiteResultWriter
extends Object

Utility writing an ISuiteResult to an XMLStringBuffer. Depending on the settings in the config property it might generate an additional XML file with the actual content and only reference the file with an url attribute in the passed XMLStringBuffer.

This is a near-clone of the original class found in org.testng.reporters, with minor changes (mostly to method visibility) to allow for extension. All modifications are clearly marked in the source code, for the purpose of easy merging with future changes to the original class.

Author:
Cosmin Marginean, Mar 16, 2007

Field Summary
protected  org.testng.reporters.XMLReporterConfig config
           
 
Constructor Summary
XMLSuiteResultWriter(org.testng.reporters.XMLReporterConfig config)
           
 
Method Summary
protected  void addAllTestResults(Set<ITestResult> testResults, IResultMap resultMap)
           
 void addTestMethodParams(org.testng.reporters.XMLStringBuffer xmlBuffer, ITestResult testResult)
           
protected  void addTestResultException(org.testng.reporters.XMLStringBuffer xmlBuffer, ITestResult testResult)
           
protected  Map<String,List<ITestResult>> buildTestClassGroups(Set<ITestResult> testResults)
           
protected  String getStatusString(int testResultStatus)
           
protected  Properties getSuiteResultAttributes(ISuiteResult suiteResult)
           
protected  Properties getTestResultAttributes(ITestResult testResult)
           
 void setConfig(org.testng.reporters.XMLReporterConfig config)
           
protected  void writeAllToBuffer(org.testng.reporters.XMLStringBuffer xmlBuffer, ISuiteResult suiteResult)
           
 void writeSuiteResult(org.testng.reporters.XMLStringBuffer xmlBuffer, ISuiteResult suiteResult)
          Writes the specified ISuiteResult in the given XMLStringBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.testng.reporters.XMLReporterConfig config
Constructor Detail

XMLSuiteResultWriter

public XMLSuiteResultWriter(org.testng.reporters.XMLReporterConfig config)
Method Detail

setConfig

public void setConfig(org.testng.reporters.XMLReporterConfig config)

writeSuiteResult

public void writeSuiteResult(org.testng.reporters.XMLStringBuffer xmlBuffer,
                             ISuiteResult suiteResult)
Writes the specified ISuiteResult in the given XMLStringBuffer. Please consider that depending on the settings in the config property it might generate an additional XML file with the actual content and only reference the file with an url attribute in the passed XMLStringBuffer.

Parameters:
xmlBuffer - The XML buffer where to write or reference the suite result
suiteResult - The ISuiteResult to serialize

writeAllToBuffer

protected void writeAllToBuffer(org.testng.reporters.XMLStringBuffer xmlBuffer,
                                ISuiteResult suiteResult)

addAllTestResults

protected void addAllTestResults(Set<ITestResult> testResults,
                                 IResultMap resultMap)

getSuiteResultAttributes

protected Properties getSuiteResultAttributes(ISuiteResult suiteResult)

buildTestClassGroups

protected Map<String,List<ITestResult>> buildTestClassGroups(Set<ITestResult> testResults)

getStatusString

protected String getStatusString(int testResultStatus)

getTestResultAttributes

protected Properties getTestResultAttributes(ITestResult testResult)

addTestMethodParams

public void addTestMethodParams(org.testng.reporters.XMLStringBuffer xmlBuffer,
                                ITestResult testResult)

addTestResultException

protected void addTestResultException(org.testng.reporters.XMLStringBuffer xmlBuffer,
                                      ITestResult testResult)


Copyright © 2009. All Rights Reserved.