public class DefaultReporterFactory extends java.lang.Object implements ReporterFactory
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
DefaultReporterFactory.TestResultType |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> |
errorTests |
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> |
failedTests |
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> |
flakyTests |
private RunStatistics |
globalStats |
private java.util.Collection<TestSetRunListener> |
listeners |
private StartupReportConfiguration |
reportConfiguration |
private StatisticsReporter |
statisticsReporter |
| Constructor and Description |
|---|
DefaultReporterFactory(StartupReportConfiguration reportConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addListener(TestSetRunListener listener) |
RunResult |
close()
Closes the factory, freeing resources allocated in the factory.
|
private DefaultDirectConsoleReporter |
createConsoleLogger() |
RunListener |
createReporter()
Creates a reporter.
|
static DefaultReporterFactory |
defaultNoXml() |
RunStatistics |
getGlobalRunStatistics() |
(package private) static DefaultReporterFactory.TestResultType |
getTestResultType(java.util.List<ReportEntryType> reportEntryList,
int rerunFailingTestsCount)
Get the result of a test based on all its runs.
|
void |
mergeFromOtherFactories(java.util.Collection<DefaultReporterFactory> factories) |
(package private) void |
mergeTestHistoryResult()
Merge all the TestMethodStats in each TestRunListeners and put results into flakyTests, failedTests and
errorTests, indexed by test class and method name.
|
(package private) boolean |
printTestFailures(DefaultDirectConsoleReporter logger,
DefaultReporterFactory.TestResultType type)
Print failed tests and flaked tests.
|
private void |
runCompleted() |
void |
runStarting() |
private RunStatistics globalStats
private final StartupReportConfiguration reportConfiguration
private final StatisticsReporter statisticsReporter
private final java.util.Collection<TestSetRunListener> listeners
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> flakyTests
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> failedTests
private java.util.Map<java.lang.String,java.util.List<TestMethodStats>> errorTests
public DefaultReporterFactory(StartupReportConfiguration reportConfiguration)
public RunListener createReporter()
ReporterFactorycreateReporter in interface ReporterFactorypublic void mergeFromOtherFactories(java.util.Collection<DefaultReporterFactory> factories)
final void addListener(TestSetRunListener listener)
public RunResult close()
ReporterFactoryclose in interface ReporterFactoryprivate DefaultDirectConsoleReporter createConsoleLogger()
public void runStarting()
private void runCompleted()
public RunStatistics getGlobalRunStatistics()
public static DefaultReporterFactory defaultNoXml()
static DefaultReporterFactory.TestResultType getTestResultType(java.util.List<ReportEntryType> reportEntryList, int rerunFailingTestsCount)
reportEntryList - the list of test run report type for a given testrerunFailingTestsCount - configured rerun count for failing testsvoid mergeTestHistoryResult()
boolean printTestFailures(DefaultDirectConsoleReporter logger, DefaultReporterFactory.TestResultType type)
logger - the logger used to log informationtype - the type of results to be printed, could be error, failure or flaketrue if printed some lines