public abstract class AbstractCompletionEstimator extends Object implements CompletionEstimator
CompletionEstimator implementation.
This class ensures that checks are done periodically, requiring that implementations
supply results for the abstract methods only.| Modifier and Type | Field and Description |
|---|---|
protected EventService |
eventService |
protected ResultService |
resultService |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCompletionEstimator(EventService eventService,
ResultService resultService) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCheckPeriod() |
double |
getCompletion()
Get the latest test completion estimate
|
protected abstract double |
getCompletionImpl()
Implementation of a fetch to get the completion state.
|
long |
getResultsFail() |
protected long |
getResultsFailImpl()
Implementation of a fetch to fetch the number of failed results
|
long |
getResultsSuccess() |
protected long |
getResultsSuccessImpl()
Implementation of a fetch to fetch the number of successful results
|
boolean |
isCompleted()
Shortcut method to determine if the test run has completed or not.
|
boolean |
isStarted()
Shortcut method to determine if the test run has started or not
If it has not started, the
completion value will be 0.0 |
void |
setCheckPeriod(long checkPeriod)
Override the
default time between calls to the underlying
data providers |
protected final EventService eventService
protected final ResultService resultService
protected AbstractCompletionEstimator(EventService eventService, ResultService resultService)
eventService - used to do the final check when completion reachers 1.0resultService - generally-useful service for estimationpublic final long getCheckPeriod()
public final void setCheckPeriod(long checkPeriod)
default time between calls to the underlying
data providerspublic final double getCompletion()
CompletionEstimatorgetCompletion in interface CompletionEstimatorpublic final long getResultsSuccess()
getResultsSuccess in interface CompletionEstimatorpublic final long getResultsFail()
getResultsFail in interface CompletionEstimatorpublic final boolean isStarted()
CompletionEstimatorcompletion value will be 0.0isStarted in interface CompletionEstimatorpublic final boolean isCompleted()
CompletionEstimatorcompletion value will be 1.0isCompleted in interface CompletionEstimatorprotected long getResultsSuccessImpl()
protected long getResultsFailImpl()
protected abstract double getCompletionImpl()
complete.Copyright © 2005–2018 Alfresco Software. All rights reserved.