Package org.testng.reporters
Class XMLReporter
java.lang.Object
org.testng.reporters.XMLReporter
- All Implemented Interfaces:
IReporter,ITestNGListener,ICustomizeXmlReport
The main entry for the XML generation operation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomTagsFor(XMLStringBuffer xmlBuffer, ITestResult testResult) static voidaddDurationAttributes(XMLReporterConfig config, Properties attributes, Date minStartDate, Date maxEndDate) Add started-at, finished-at and duration-ms attributes to the<suite>tagfileName()voidGenerate a report for the given suites into the specified output directory.Get the reporter configuration object.private PropertiesgetSuiteAttributes(ISuite suite) private Set<ITestNGMethod>getUniqueMethodSet(Collection<ITestNGMethod> methods) private FilereferenceSuite(XMLStringBuffer xmlBuffer, ISuite suite) private voidwriteReporterOutput(XMLStringBuffer xmlBuffer) private voidwriteSuite(ISuite suite) private voidwriteSuiteGroups(XMLStringBuffer xmlBuffer, ISuite suite) private voidwriteSuiteToBuffer(XMLStringBuffer xmlBuffer, ISuite suite) private voidwriteSuiteToFile(File suiteFile, ISuite suite)
-
Field Details
-
config
-
rootBuffer
-
-
Constructor Details
-
XMLReporter
public XMLReporter()
-
-
Method Details
-
generateReport
Description copied from interface:IReporterGenerate a report for the given suites into the specified output directory.- Specified by:
generateReportin interfaceIReporter- Parameters:
xmlSuites- The list ofXmlSuitesuites- The list ofISuiteoutputDirectory- The output directory
-
addCustomTagsFor
- Specified by:
addCustomTagsForin interfaceICustomizeXmlReport- Parameters:
xmlBuffer- - AnXMLStringBufferobject that represents the buffer to be used.testResult- - AnITestResultobject that represents a test method's result.
-
fileName
-
writeReporterOutput
-
writeSuite
-
writeSuiteToFile
-
referenceSuite
-
writeSuiteToBuffer
-
writeSuiteGroups
-
getSuiteAttributes
-
addDurationAttributes
public static void addDurationAttributes(XMLReporterConfig config, Properties attributes, Date minStartDate, Date maxEndDate) Add started-at, finished-at and duration-ms attributes to the<suite>tag- Parameters:
config- The reporter configattributes- The propertiesminStartDate- The minimum start datemaxEndDate- The maximum end date
-
getUniqueMethodSet
-
getConfig
Description copied from interface:IReporterGet the reporter configuration object.NOTE: Reporter configuration objects must adhere to the JavaBean object conventions, providing getter and setter methods that conform to standard naming rules. This enables
ReporterConfigto serialize, deserialize, and instantiate the reporter.
-