public class JUnitReportReporter extends java.lang.Object implements IReporter
Modifier and Type | Class and Description |
---|---|
private static class |
JUnitReportReporter.TestTag |
Constructor and Description |
---|
JUnitReportReporter() |
Modifier and Type | Method and Description |
---|---|
private void |
addMapping(SetMultiMap<java.lang.Class<?>,ITestNGMethod> mapping,
java.util.Collection<ITestNGMethod> methods) |
private void |
addResults(java.util.Set<ITestResult> allResults,
java.util.Map<java.lang.Class<?>,java.util.Set<ITestResult>> out) |
private JUnitReportReporter.TestTag |
createIgnoredTestTagFor(ITestNGMethod method) |
private JUnitReportReporter.TestTag |
createTestTagFor(ITestResult tr,
java.lang.Class<?> cls) |
private java.lang.String |
formatTime(float time) |
void |
generateReport(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 int |
getDisabledTestCount(java.util.Set<ITestNGMethod> methods) |
protected java.lang.String |
getFileName(java.lang.Class cls) |
private long |
getNextConfiguration(ListMultiMap<java.lang.Object,ITestResult> configurations,
ITestResult tr)
Add the time of the configuration method to this test method.
|
protected java.lang.String |
getTestName(ITestResult tr) |
private static void |
handleFailure(JUnitReportReporter.TestTag testTag,
java.lang.Throwable t) |
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
|
private void |
safeSetProperty(java.util.Properties p,
java.lang.String key,
java.lang.String value)
Set property if value is non-null
|
private static java.util.Collection<ITestResult> |
sort(java.util.Set<ITestResult> results) |
public void generateReport(java.util.List<XmlSuite> xmlSuites, java.util.List<ISuite> suites, java.lang.String defaultOutputDirectory)
IReporter
generateReport
in interface IReporter
private static java.util.Collection<ITestResult> sort(java.util.Set<ITestResult> results)
private static int getDisabledTestCount(java.util.Set<ITestNGMethod> methods)
private JUnitReportReporter.TestTag createIgnoredTestTagFor(ITestNGMethod method)
private JUnitReportReporter.TestTag createTestTagFor(ITestResult tr, java.lang.Class<?> cls)
private static void handleFailure(JUnitReportReporter.TestTag testTag, java.lang.Throwable t)
private boolean putElement(XMLStringBuffer xsb, java.lang.String tagName, java.util.Properties attributes, boolean hasChildElements)
private void safeSetProperty(java.util.Properties p, java.lang.String key, java.lang.String value)
private long getNextConfiguration(ListMultiMap<java.lang.Object,ITestResult> configurations, ITestResult tr)
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.
protected java.lang.String getFileName(java.lang.Class cls)
protected java.lang.String getTestName(ITestResult tr)
private java.lang.String formatTime(float time)
private void addResults(java.util.Set<ITestResult> allResults, java.util.Map<java.lang.Class<?>,java.util.Set<ITestResult>> out)
private void addMapping(SetMultiMap<java.lang.Class<?>,ITestNGMethod> mapping, java.util.Collection<ITestNGMethod> methods)