Package org.testng.reporters
Class JUnitReportReporter
java.lang.Object
org.testng.reporters.JUnitReportReporter
- All Implemented Interfaces:
IReporter,ITestNGListener
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddMapping(SetMultiMap<Class<?>, ITestNGMethod> mapping, Collection<ITestNGMethod> methods) private voidaddResults(Set<ITestResult> allResults, Map<Class<?>, Set<ITestResult>> out) private JUnitReportReporter.TestTagcreateIgnoredTestTagFor(ITestNGMethod method) private JUnitReportReporter.TestTagcreateTestTagFor(ITestResult tr, Class<?> cls) private StringformatTime(float time) voidGenerate a report for the given suites into the specified output directory.private static intgetDisabledTestCount(Set<ITestNGMethod> methods) protected StringgetFileName(Class cls) private static Stringprivate longgetNextConfiguration(ListMultiMap<Object, ITestResult> configurations, ITestResult tr) Add the time of the configuration method to this test method.protected Stringprivate static voidhandleFailure(JUnitReportReporter.TestTag testTag, Throwable t) private booleanputElement(XMLStringBuffer xsb, String tagName, Properties attributes, boolean hasChildElements) Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameterprivate voidsafeSetProperty(Properties p, String key, String value) Set property if value is non-nullprivate static Collection<ITestResult> sort(Set<ITestResult> results)
-
Constructor Details
-
JUnitReportReporter
public JUnitReportReporter()
-
-
Method Details
-
generateReport
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String defaultOutputDirectory) Description copied from interface:IReporterGenerate a report for the given suites into the specified output directory.- Specified by:
generateReportin interfaceIReporter- Parameters:
xmlSuites- The list ofXmlSuitesuites- The list ofISuitedefaultOutputDirectory- The output directory
-
sort
-
getHostName
-
getDisabledTestCount
-
createIgnoredTestTagFor
-
createTestTagFor
-
handleFailure
-
putElement
private boolean putElement(XMLStringBuffer xsb, String tagName, Properties attributes, boolean hasChildElements) Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameter -
safeSetProperty
Set property if value is non-null -
getNextConfiguration
Add the time of the configuration method to this test method.The only problem with this method is that the timing of a test method might not be added to the time of the same configuration method that ran before it but since they should all be equivalent, this should never be an issue.
-
getFileName
-
getTestName
-
formatTime
-
addResults
-
addMapping
private void addMapping(SetMultiMap<Class<?>, ITestNGMethod> mapping, Collection<ITestNGMethod> methods)
-