Top Description Fields Constructors Methods
org.testng.reporters

public Class FailedReporter

extends Object
implements IReporter
Class Inheritance
All Implemented Interfaces
org.testng.IReporter, org.testng.ITestNGListener
Imports
java.util.ArrayList, .Arrays, .Collection, .Collections, .HashSet, .List, .Map, .Set, java.util.concurrent.atomic.AtomicInteger, java.util.stream.Collectors, .Stream, org.testng.IReporter, .ISuite, .ISuiteResult, .ITestClass, .ITestContext, .ITestNGMethod, .ITestResult, org.testng.collections.Lists, .Maps, .Sets, org.testng.internal.ConstructorOrMethod, .LiteWeightTestNGMethod, .MethodHelper, .MethodSorting, .RuntimeBehavior, .Utils, org.testng.xml.XmlClass, .XmlInclude, .XmlSuite, .XmlTest

This reporter is responsible for creating testng-failed.xml
Authors
Cedric Beust, Alexandru Popescu

Field Summary

Modifier and TypeField and Description
private XmlSuite
public static final String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
private static List<XmlInclude>
asXmlIncludes(List<ITestNGMethod> methods, XmlTest srcXmlTest)

private List<XmlClass>

Returns:

A list of XmlClass objects (each representing a tag) based on the parameter methods
createXmlClasses
(List<ITestNGMethod>
The methods we want to represent
methods
,
XmlTest
The XmlTest object that represents the source.
srcXmlTest
)

private void
createXmlTest(ITestContext context, List<ITestNGMethod> methods, XmlTest srcXmlTest)

Generate testng-failed.xml

private static Map<String, String>

Returns:

local parameters belong to one test method.
findMethodLocalParameters
(XmlTest
The XmlTest object that represents the source.
srcXmlTest
,
ITestNGMethod
the method we want to find its parameters
method
)

Get local parameters of one include method from origin test xml.

protected void
generateFailureSuite(XmlSuite xmlSuite, ISuite suite, String outputDir)

public void
generateReport(List<XmlSuite>
The list of XmlSuite
xmlSuites
,
List<ISuite>
The list of ISuite
suites
,
String
The output directory
outputDirectory
)

Overrides default org.testng.IReporter.generateReport.

Generate a report for the given suites into the specified output directory.
private void
generateXmlTest(XmlTest xmlTest, ITestContext context, Set<ITestResult> failedTests, Set<ITestResult> skippedTests)

private static void
private static void
private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_xmlSuiteback to summary
private XmlSuite m_xmlSuite
TESTNG_FAILED_XMLback to summary
public static final String TESTNG_FAILED_XML

Constructor Detail

FailedReporterback to summary
public FailedReporter()
FailedReporterback to summary
public FailedReporter(XmlSuite xmlSuite)
Annotations
@SuppressWarnings:unused

Method Detail

asXmlIncludesback to summary
private static List<XmlInclude> asXmlIncludes(List<ITestNGMethod> methods, XmlTest srcXmlTest)
createXmlClassesback to summary
private List<XmlClass> createXmlClasses(List<ITestNGMethod> methods, XmlTest srcXmlTest)
Parameters
methods:List<ITestNGMethod>

The methods we want to represent

srcXmlTest:XmlTest

The XmlTest object that represents the source.

Returns:List<XmlClass>

A list of XmlClass objects (each representing a tag) based on the parameter methods

createXmlTestback to summary
private void createXmlTest(ITestContext context, List<ITestNGMethod> methods, XmlTest srcXmlTest)

Generate testng-failed.xml

findMethodLocalParametersback to summary
private static Map<String, String> findMethodLocalParameters(XmlTest srcXmlTest, ITestNGMethod method)

Get local parameters of one include method from origin test xml.

Parameters
srcXmlTest:XmlTest

The XmlTest object that represents the source.

method:ITestNGMethod

the method we want to find its parameters

Returns:Map<String, String>

local parameters belong to one test method.

generateFailureSuiteback to summary
protected void generateFailureSuite(XmlSuite xmlSuite, ISuite suite, String outputDir)
generateReportback to summary
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory)

Overrides default org.testng.IReporter.generateReport.

Doc from org.testng.IReporter.generateReport.

Generate a report for the given suites into the specified output directory.

Parameters
xmlSuites:List<XmlSuite>

The list of XmlSuite

suites:List<ISuite>

The list of ISuite

outputDirectory:String

The output directory

Annotations
@Override
generateXmlTestback to summary
private void generateXmlTest(XmlTest xmlTest, ITestContext context, Set<ITestResult> failedTests, Set<ITestResult> skippedTests)
getAllApplicableConfigsback to summary
private static void getAllApplicableConfigs(Set<ITestNGMethod> configs, ITestClass iTestClass)
getAllGroupApplicableConfigsback to summary
private static void getAllGroupApplicableConfigs(ITestContext context, Set<ITestNGMethod> relevantConfigs, ITestNGMethod m)
isNotClassLevelConfigurationMethodback to summary
private static boolean isNotClassLevelConfigurationMethod(ITestNGMethod each)