Package org.testng.reporters
Class XMLReporter
- java.lang.Object
-
- org.testng.reporters.XMLReporter
-
- All Implemented Interfaces:
IReporter
,ITestNGListener
,ICustomizeXmlReport
public class XMLReporter extends java.lang.Object implements IReporter, ICustomizeXmlReport
The main entry for the XML generation operation
-
-
Constructor Summary
Constructors Constructor Description XMLReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCustomTagsFor(XMLStringBuffer xmlBuffer, ITestResult testResult)
static void
addDurationAttributes(XMLReporterConfig config, java.util.Properties attributes, java.util.Date minStartDate, java.util.Date maxEndDate)
Add started-at, finished-at and duration-ms attributes to the<suite>
tagjava.lang.String
fileName()
void
generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String outputDirectory)
Generate a report for the given suites into the specified output directory.XMLReporterConfig
getConfig()
Get the reporter configuration object.
-
-
-
Method Detail
-
generateReport
public void generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String outputDirectory)
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
public void addCustomTagsFor(XMLStringBuffer xmlBuffer, ITestResult testResult)
- 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
public java.lang.String fileName()
-
addDurationAttributes
public static void addDurationAttributes(XMLReporterConfig config, java.util.Properties attributes, java.util.Date minStartDate, java.util.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
-
getConfig
public XMLReporterConfig 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.
-
-