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 TypeMethodDescriptionvoid
addCustomTagsFor
(XMLStringBuffer xmlBuffer, ITestResult testResult) static void
addDurationAttributes
(XMLReporterConfig config, Properties attributes, Date minStartDate, Date maxEndDate) Add started-at, finished-at and duration-ms attributes to the<suite>
tagfileName()
void
Generate a report for the given suites into the specified output directory.Get the reporter configuration object.private Properties
getSuiteAttributes
(ISuite suite) private Set<ITestNGMethod>
getUniqueMethodSet
(Collection<ITestNGMethod> methods) private File
referenceSuite
(XMLStringBuffer xmlBuffer, ISuite suite) private void
writeReporterOutput
(XMLStringBuffer xmlBuffer) private void
writeSuite
(ISuite suite) private void
writeSuiteGroups
(XMLStringBuffer xmlBuffer, ISuite suite) private void
writeSuiteToBuffer
(XMLStringBuffer xmlBuffer, ISuite suite) private void
writeSuiteToFile
(File suiteFile, ISuite suite)
-
Field Details
-
config
-
rootBuffer
-
-
Constructor Details
-
XMLReporter
public XMLReporter()
-
-
Method Details
-
generateReport
Description copied from interface:IReporter
Generate a report for the given suites into the specified output directory.- Specified by:
generateReport
in interfaceIReporter
- Parameters:
xmlSuites
- The list ofXmlSuite
suites
- The list ofISuite
outputDirectory
- The output directory
-
addCustomTagsFor
- Specified by:
addCustomTagsFor
in interfaceICustomizeXmlReport
- Parameters:
xmlBuffer
- - AnXMLStringBuffer
object that represents the buffer to be used.testResult
- - AnITestResult
object 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:IReporter
Get 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
ReporterConfig
to serialize, deserialize, and instantiate the reporter.
-