T
- the type used to run this scenariopublic abstract class AbstractUsageScenario<T> extends Object implements UsageScenario<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractUsageScenario()
Instantiates a new UsageScenario using the simple class name as scenario name
|
protected |
AbstractUsageScenario(String name)
Instantiates a new UsageScenario with the given name
|
protected |
AbstractUsageScenario(String name,
int maximumTimeMs)
Instantiates a new UsageScenario with the given name
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanup(T application)
Called after this scenario has been run, override to clean up the application after each run
|
void |
clearExceptions()
Clears the exceptions that have been collected so far
|
int |
defaultWeight() |
boolean |
equals(Object obj) |
List<Throwable> |
exceptions() |
int |
hashCode() |
int |
maximumTime()
The maximum time in milliseconds this scenario can run before issuing a warning.
|
String |
name() |
protected abstract void |
perform(T application)
Runs a set of actions on the given application.
|
protected void |
prepare(T application)
Called before this scenario is run, override to prepare the application for each run
|
void |
resetRunCount()
Resets the run counters
|
void |
run(T application)
Runs this scenario with the given application
|
int |
successfulRunCount() |
String |
toString() |
int |
totalRunCount() |
int |
unsuccessfulRunCount() |
protected AbstractUsageScenario()
protected AbstractUsageScenario(String name)
name
- the scenario nameprotected AbstractUsageScenario(String name, int maximumTimeMs)
name
- the scenario namemaximumTimeMs
- the maximum time in milliseconds this scenario should take to runpublic final String name()
name
in interface UsageScenario<T>
public final int maximumTime()
UsageScenario
maximumTime
in interface UsageScenario<T>
public final int successfulRunCount()
successfulRunCount
in interface UsageScenario<T>
public final int unsuccessfulRunCount()
unsuccessfulRunCount
in interface UsageScenario<T>
public final int totalRunCount()
totalRunCount
in interface UsageScenario<T>
public final List<Throwable> exceptions()
exceptions
in interface UsageScenario<T>
public final void resetRunCount()
UsageScenario
resetRunCount
in interface UsageScenario<T>
public final void clearExceptions()
UsageScenario
clearExceptions
in interface UsageScenario<T>
public final void run(T application)
UsageScenario
run
in interface UsageScenario<T>
application
- the application to usepublic int defaultWeight()
defaultWeight
in interface UsageScenario<T>
protected abstract void perform(T application) throws Exception
application
- the applicationException
- in case of an exceptionprotected void prepare(T application)
application
- the applicationprotected void cleanup(T application)
application
- the application