Package org.testng.reporters
Class FailedReporter
- java.lang.Object
-
- org.testng.reporters.FailedReporter
-
- All Implemented Interfaces:
IReporter
,ITestNGListener
public class FailedReporter extends java.lang.Object implements IReporter
This reporter is responsible for creating testng-failed.xml
-
-
Field Summary
Fields Modifier and Type Field Description private XmlSuite
m_xmlSuite
static java.lang.String
TESTNG_FAILED_XML
-
Constructor Summary
Constructors Constructor Description FailedReporter()
FailedReporter(XmlSuite xmlSuite)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.List<XmlInclude>
asXmlIncludes(java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
private java.util.List<XmlClass>
createXmlClasses(java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
private void
createXmlTest(ITestContext context, java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
Generate testng-failed.xmlprivate static java.util.Map<java.lang.String,java.lang.String>
findMethodLocalParameters(XmlTest srcXmlTest, ITestNGMethod method)
Get local parameters of one include method from origin test xml.protected void
generateFailureSuite(XmlSuite xmlSuite, ISuite suite, java.lang.String outputDir)
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.private void
generateXmlTest(XmlTest xmlTest, ITestContext context, java.util.Set<ITestResult> failedTests, java.util.Set<ITestResult> skippedTests)
private static void
getAllApplicableConfigs(java.util.Set<ITestNGMethod> configs, ITestClass iTestClass)
private static void
getAllGroupApplicableConfigs(ITestContext context, java.util.Set<ITestNGMethod> relevantConfigs, ITestNGMethod m)
private static boolean
isNotClassLevelConfigurationMethod(ITestNGMethod each)
-
-
-
Field Detail
-
TESTNG_FAILED_XML
public static final java.lang.String TESTNG_FAILED_XML
- See Also:
- Constant Field Values
-
m_xmlSuite
private XmlSuite m_xmlSuite
-
-
Constructor Detail
-
FailedReporter
public FailedReporter()
-
FailedReporter
public FailedReporter(XmlSuite xmlSuite)
-
-
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
-
generateFailureSuite
protected void generateFailureSuite(XmlSuite xmlSuite, ISuite suite, java.lang.String outputDir)
-
generateXmlTest
private void generateXmlTest(XmlTest xmlTest, ITestContext context, java.util.Set<ITestResult> failedTests, java.util.Set<ITestResult> skippedTests)
-
isNotClassLevelConfigurationMethod
private static boolean isNotClassLevelConfigurationMethod(ITestNGMethod each)
-
getAllApplicableConfigs
private static void getAllApplicableConfigs(java.util.Set<ITestNGMethod> configs, ITestClass iTestClass)
-
getAllGroupApplicableConfigs
private static void getAllGroupApplicableConfigs(ITestContext context, java.util.Set<ITestNGMethod> relevantConfigs, ITestNGMethod m)
-
createXmlTest
private void createXmlTest(ITestContext context, java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
Generate testng-failed.xml
-
createXmlClasses
private java.util.List<XmlClass> createXmlClasses(java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
- Parameters:
methods
- The methods we want to representsrcXmlTest
- TheXmlTest
object that represents the source.- Returns:
- A list of XmlClass objects (each representing a
tag) based on the parameter methods
-
findMethodLocalParameters
private static java.util.Map<java.lang.String,java.lang.String> findMethodLocalParameters(XmlTest srcXmlTest, ITestNGMethod method)
Get local parameters of one include method from origin test xml.- Parameters:
srcXmlTest
- TheXmlTest
object that represents the source.method
- the method we want to find its parameters- Returns:
- local parameters belong to one test method.
-
asXmlIncludes
private static java.util.List<XmlInclude> asXmlIncludes(java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)
-
-