Class FailedReporter

java.lang.Object
org.testng.reporters.FailedReporter
All Implemented Interfaces:
IReporter, ITestNGListener

public class FailedReporter extends Object implements IReporter
This reporter is responsible for creating testng-failed.xml
  • Field Details

  • Constructor Details

    • FailedReporter

      public FailedReporter()
    • FailedReporter

      public FailedReporter(XmlSuite xmlSuite)
  • Method Details

    • generateReport

      public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory)
      Description copied from interface: IReporter
      Generate a report for the given suites into the specified output directory.
      Specified by:
      generateReport in interface IReporter
      Parameters:
      xmlSuites - The list of XmlSuite
      suites - The list of ISuite
      outputDirectory - The output directory
    • generateFailureSuite

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

      private void generateXmlTest(XmlTest xmlTest, ITestContext context, Set<ITestResult> failedTests, Set<ITestResult> skippedTests)
    • getAllApplicableConfigs

      private static void getAllApplicableConfigs(Set<ITestNGMethod> configs, ITestClass iTestClass)
    • createXmlTest

      private void createXmlTest(ITestContext context, List<ITestNGMethod> methods, XmlTest srcXmlTest)
      Generate testng-failed.xml
    • createXmlClasses

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

      private static Map<String,String> findMethodLocalParameters(XmlTest srcXmlTest, ITestNGMethod method)
      Get local parameters of one include method from origin test xml.
      Parameters:
      srcXmlTest - The XmlTest object that represents the source.
      method - the method we want to find its parameters
      Returns:
      local parameters belong to one test method.