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 void
addMapping
(SetMultiMap<Class<?>, ITestNGMethod> mapping, Collection<ITestNGMethod> methods) private void
addResults
(Set<ITestResult> allResults, Map<Class<?>, Set<ITestResult>> out) private JUnitReportReporter.TestTag
createIgnoredTestTagFor
(ITestNGMethod method) private JUnitReportReporter.TestTag
createTestTagFor
(ITestResult tr, Class<?> cls) private String
formatTime
(float time) void
Generate a report for the given suites into the specified output directory.private static int
getDisabledTestCount
(Set<ITestNGMethod> methods) protected String
getFileName
(Class cls) private long
getNextConfiguration
(ListMultiMap<Object, ITestResult> configurations, ITestResult tr) Add the time of the configuration method to this test method.protected String
private static void
handleFailure
(JUnitReportReporter.TestTag testTag, Throwable t) private boolean
putElement
(XMLStringBuffer xsb, String tagName, Properties attributes, boolean hasChildElements) Put a XML start or empty tag to the XMLStringBuffer depending on hasChildElements parameterprivate void
safeSetProperty
(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: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
defaultOutputDirectory
- The output directory
-
sort
-
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)
-