Package org.testng.reporters
Class FailedReporter
- java.lang.Object
-
- org.testng.TestListenerAdapter
-
- org.testng.reporters.FailedReporter
-
- All Implemented Interfaces:
IConfigurationListener,IConfigurationListener2,IResultListener,IResultListener2,IReporter,ITestListener,ITestNGListener
public class FailedReporter extends TestListenerAdapter implements IReporter
This reporter is responsible for creating testng-failed.xml
-
-
Field Summary
Fields Modifier and Type Field Description private XmlSuitem_xmlSuitestatic java.lang.StringTESTNG_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 java.util.List<XmlClass>createXmlClasses(java.util.List<ITestNGMethod> methods, XmlTest srcXmlTest)private voidcreateXmlTest(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 voidgenerateFailureSuite(XmlSuite xmlSuite, ISuite suite, java.lang.String outputDir)voidgenerateReport(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 voidgenerateXmlTest(XmlTest xmlTest, ITestContext context, java.util.Set<ITestResult> failedTests, java.util.Set<ITestResult> skippedTests)private static voidgetAllApplicableConfigs(java.util.Set<ITestNGMethod> configs, ITestClass iTestClass)-
Methods inherited from class org.testng.TestListenerAdapter
beforeConfiguration, getAllTestMethods, getConfigurationFailures, getConfigurationSkips, getFailedButWithinSuccessPercentageTests, getFailedTests, getPassedTests, getSkippedTests, getTestContexts, onConfigurationFailure, onConfigurationSkip, onConfigurationSuccess, onFinish, onStart, onTestFailedButWithinSuccessPercentage, onTestFailure, onTestSkipped, onTestStart, onTestSuccess, setAllTestMethods, setFailedButWithinSuccessPercentageTests, setFailedTests, setPassedTests, setSkippedTests, toString
-
-
-
-
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:IReporterGenerate a report for the given suites into the specified output directory.- Specified by:
generateReportin interfaceIReporter
-
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)
-
getAllApplicableConfigs
private static void getAllApplicableConfigs(java.util.Set<ITestNGMethod> configs, ITestClass iTestClass)
-
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- TheXmlTestobject 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- TheXmlTestobject that represents the source.method- the method we want to find its parameters- Returns:
- local parameters belong to one test method.
-
-