Package org.testng.reporters
Class XMLReporter
- java.lang.Object
-
- org.testng.reporters.XMLReporter
-
- All Implemented Interfaces:
IReporter
,ITestNGListener
public class XMLReporter extends java.lang.Object implements IReporter
The main entry for the XML generation operation
-
-
Field Summary
Fields Modifier and Type Field Description private XMLReporterConfig
config
static java.lang.String
FILE_NAME
private static java.lang.String
JVM_ARG
private XMLStringBuffer
rootBuffer
-
Constructor Summary
Constructors Constructor Description XMLReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 thetag private static java.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()
int
getFileFragmentationLevel()
Deprecated.Unusedjava.lang.String
getOutputDirectory()
Deprecated.Use #getConfig() insteadint
getStackTraceOutputMethod()
Deprecated.Use #getConfig() insteadprivate java.util.Properties
getSuiteAttributes(ISuite suite)
java.lang.String
getTimestampFormat()
Deprecated.Use #getConfig() insteadprivate java.util.Set<ITestNGMethod>
getUniqueMethodSet(java.util.Collection<ITestNGMethod> methods)
boolean
isGenerateDependsOnGroups()
Deprecated.Use #getConfig() insteadboolean
isGenerateDependsOnMethods()
Deprecated.Use #getConfig() insteadboolean
isGenerateGroupsAttribute()
Deprecated.Use #getConfig() insteadboolean
isGenerateTestResultAttributes()
Deprecated.Use #getConfig() insteadboolean
isSplitClassAndPackageNames()
Deprecated.Use #getConfig() insteadprivate java.io.File
referenceSuite(XMLStringBuffer xmlBuffer, ISuite suite)
void
setFileFragmentationLevel(int fileFragmentationLevel)
Deprecated.Unusedvoid
setGenerateDependsOnGroups(boolean generateDependsOnGroups)
Deprecated.Use #getConfig() insteadvoid
setGenerateDependsOnMethods(boolean generateDependsOnMethods)
Deprecated.Use #getConfig() insteadvoid
setGenerateGroupsAttribute(boolean generateGroupsAttribute)
Deprecated.Use #getConfig() insteadvoid
setGenerateTestResultAttributes(boolean generateTestResultAttributes)
Deprecated.Use #getConfig() insteadvoid
setOutputDirectory(java.lang.String outputDirectory)
Deprecated.Use #getConfig() insteadvoid
setSplitClassAndPackageNames(boolean splitClassAndPackageNames)
Deprecated.Use #getConfig() insteadvoid
setStackTraceOutputMethod(int stackTraceOutputMethod)
Deprecated.Use #getConfig() insteadvoid
setTimestampFormat(java.lang.String timestampFormat)
Deprecated.Use #getConfig() insteadprivate 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(java.io.File suiteFile, ISuite suite)
-
-
-
Field Detail
-
FILE_NAME
public static final java.lang.String FILE_NAME
- See Also:
- Constant Field Values
-
JVM_ARG
private static final java.lang.String JVM_ARG
- See Also:
- Constant Field Values
-
config
private final XMLReporterConfig config
-
rootBuffer
private XMLStringBuffer rootBuffer
-
-
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
-
fileName
private static final java.lang.String fileName()
-
writeReporterOutput
private void writeReporterOutput(XMLStringBuffer xmlBuffer)
-
writeSuite
private void writeSuite(ISuite suite)
-
writeSuiteToFile
private void writeSuiteToFile(java.io.File suiteFile, ISuite suite)
-
referenceSuite
private java.io.File referenceSuite(XMLStringBuffer xmlBuffer, ISuite suite)
-
writeSuiteToBuffer
private void writeSuiteToBuffer(XMLStringBuffer xmlBuffer, ISuite suite)
-
writeSuiteGroups
private void writeSuiteGroups(XMLStringBuffer xmlBuffer, ISuite suite)
-
getSuiteAttributes
private java.util.Properties getSuiteAttributes(ISuite suite)
-
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 thetag
-
getUniqueMethodSet
private java.util.Set<ITestNGMethod> getUniqueMethodSet(java.util.Collection<ITestNGMethod> methods)
-
getFileFragmentationLevel
@Deprecated public int getFileFragmentationLevel()
Deprecated.Unused
-
setFileFragmentationLevel
@Deprecated public void setFileFragmentationLevel(int fileFragmentationLevel)
Deprecated.Unused
-
getStackTraceOutputMethod
@Deprecated public int getStackTraceOutputMethod()
Deprecated.Use #getConfig() instead
-
setStackTraceOutputMethod
@Deprecated public void setStackTraceOutputMethod(int stackTraceOutputMethod)
Deprecated.Use #getConfig() instead
-
getOutputDirectory
@Deprecated public java.lang.String getOutputDirectory()
Deprecated.Use #getConfig() instead
-
setOutputDirectory
@Deprecated public void setOutputDirectory(java.lang.String outputDirectory)
Deprecated.Use #getConfig() instead
-
isGenerateGroupsAttribute
@Deprecated public boolean isGenerateGroupsAttribute()
Deprecated.Use #getConfig() instead
-
setGenerateGroupsAttribute
@Deprecated public void setGenerateGroupsAttribute(boolean generateGroupsAttribute)
Deprecated.Use #getConfig() instead
-
isSplitClassAndPackageNames
@Deprecated public boolean isSplitClassAndPackageNames()
Deprecated.Use #getConfig() instead
-
setSplitClassAndPackageNames
@Deprecated public void setSplitClassAndPackageNames(boolean splitClassAndPackageNames)
Deprecated.Use #getConfig() instead
-
getTimestampFormat
@Deprecated public java.lang.String getTimestampFormat()
Deprecated.Use #getConfig() instead
-
setTimestampFormat
@Deprecated public void setTimestampFormat(java.lang.String timestampFormat)
Deprecated.Use #getConfig() instead
-
isGenerateDependsOnMethods
@Deprecated public boolean isGenerateDependsOnMethods()
Deprecated.Use #getConfig() instead
-
setGenerateDependsOnMethods
@Deprecated public void setGenerateDependsOnMethods(boolean generateDependsOnMethods)
Deprecated.Use #getConfig() instead
-
setGenerateDependsOnGroups
@Deprecated public void setGenerateDependsOnGroups(boolean generateDependsOnGroups)
Deprecated.Use #getConfig() instead
-
isGenerateDependsOnGroups
@Deprecated public boolean isGenerateDependsOnGroups()
Deprecated.Use #getConfig() instead
-
setGenerateTestResultAttributes
@Deprecated public void setGenerateTestResultAttributes(boolean generateTestResultAttributes)
Deprecated.Use #getConfig() instead
-
isGenerateTestResultAttributes
@Deprecated public boolean isGenerateTestResultAttributes()
Deprecated.Use #getConfig() instead
-
getConfig
public XMLReporterConfig getConfig()
-
-