Package org.testng.reporters
Class JUnitReportReporter
- java.lang.Object
-
- org.testng.reporters.JUnitReportReporter
-
- All Implemented Interfaces:
IReporter,ITestNGListener
public class JUnitReportReporter extends java.lang.Object implements IReporter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJUnitReportReporter.TestTag
-
Constructor Summary
Constructors Constructor Description JUnitReportReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddMapping(SetMultiMap<java.lang.Class<?>,ITestNGMethod> mapping, java.util.Collection<ITestNGMethod> methods)private voidaddResults(java.util.Set<ITestResult> allResults, java.util.Map<java.lang.Class<?>,java.util.Set<ITestResult>> out)private JUnitReportReporter.TestTagcreateIgnoredTestTagFor(ITestNGMethod method)private JUnitReportReporter.TestTagcreateTestTagFor(ITestResult tr, java.lang.Class<?> cls)private java.lang.StringformatTime(float time)voidgenerateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String defaultOutputDirectory)Generate a report for the given suites into the specified output directory.private static intgetDisabledTestCount(java.util.Set<ITestNGMethod> methods)protected java.lang.StringgetFileName(java.lang.Class cls)private longgetNextConfiguration(ListMultiMap<java.lang.Object,ITestResult> configurations, ITestResult tr)Add the time of the configuration method to this test method.protected java.lang.StringgetTestName(ITestResult tr)private static voidhandleFailure(JUnitReportReporter.TestTag testTag, java.lang.Throwable t)private booleanputElement(XMLStringBuffer xsb, java.lang.String tagName, java.util.Properties attributes, boolean hasChildElements)Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameterprivate voidsafeSetProperty(java.util.Properties p, java.lang.String key, java.lang.String value)Set property if value is non-nullprivate static java.util.Collection<ITestResult>sort(java.util.Set<ITestResult> results)
-
-
-
Method Detail
-
generateReport
public void generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.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
private static java.util.Collection<ITestResult> sort(java.util.Set<ITestResult> results)
-
getDisabledTestCount
private static int getDisabledTestCount(java.util.Set<ITestNGMethod> methods)
-
createIgnoredTestTagFor
private JUnitReportReporter.TestTag createIgnoredTestTagFor(ITestNGMethod method)
-
createTestTagFor
private JUnitReportReporter.TestTag createTestTagFor(ITestResult tr, java.lang.Class<?> cls)
-
handleFailure
private static void handleFailure(JUnitReportReporter.TestTag testTag, java.lang.Throwable t)
-
putElement
private boolean putElement(XMLStringBuffer xsb, java.lang.String tagName, java.util.Properties attributes, boolean hasChildElements)
Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameter
-
safeSetProperty
private void safeSetProperty(java.util.Properties p, java.lang.String key, java.lang.String value)Set property if value is non-null
-
getNextConfiguration
private long getNextConfiguration(ListMultiMap<java.lang.Object,ITestResult> configurations, ITestResult tr)
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
protected java.lang.String getFileName(java.lang.Class cls)
-
getTestName
protected java.lang.String getTestName(ITestResult tr)
-
formatTime
private java.lang.String formatTime(float time)
-
addResults
private void addResults(java.util.Set<ITestResult> allResults, java.util.Map<java.lang.Class<?>,java.util.Set<ITestResult>> out)
-
addMapping
private void addMapping(SetMultiMap<java.lang.Class<?>,ITestNGMethod> mapping, java.util.Collection<ITestNGMethod> methods)
-
-