Class AbstractUsageScenario<T>
java.lang.Object
is.codion.swing.common.model.tools.loadtest.AbstractUsageScenario<T>
- Type Parameters:
T- the application type used to run this scenario
- All Implemented Interfaces:
UsageScenario<T>
- Direct Known Subclasses:
QueryLoadTestModel.QueryScenario
An abstract usage scenario.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.swing.common.model.tools.loadtest.UsageScenario
UsageScenario.RunResult -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates a new UsageScenario using the simple class name as scenario nameprotectedAbstractUsageScenario(String name) Instantiates a new UsageScenario with the given nameprotectedAbstractUsageScenario(String name, int maximumTimeMs) Instantiates a new UsageScenario with the given name -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled after this scenario has been run, override to clean up the application after each runfinal voidClears the exceptions that have been collected so farintfinal booleanfinal inthashCode()final intThe maximum time in milliseconds this scenario can run before issuing a warning.final Stringname()protected abstract voidRuns a set of actions on the given application.protected voidCalled before this scenario is run, override to prepare the application for each runfinal voidResets the run countersfinal UsageScenario.RunResultRuns this scenario with the given applicationfinal intfinal StringtoString()final intfinal int
-
Constructor Details
-
AbstractUsageScenario
protected AbstractUsageScenario()Instantiates a new UsageScenario using the simple class name as scenario name -
AbstractUsageScenario
Instantiates a new UsageScenario with the given name- Parameters:
name- the scenario name
-
AbstractUsageScenario
Instantiates a new UsageScenario with the given name- Parameters:
name- the scenario namemaximumTimeMs- the maximum time in milliseconds this scenario should take to run
-
-
Method Details
-
name
- Specified by:
namein interfaceUsageScenario<T>- Returns:
- the name of this scenario
-
maximumTime
public final int maximumTime()Description copied from interface:UsageScenarioThe maximum time in milliseconds this scenario can run before issuing a warning.- Specified by:
maximumTimein interfaceUsageScenario<T>- Returns:
- the warning time
-
successfulRunCount
public final int successfulRunCount()- Specified by:
successfulRunCountin interfaceUsageScenario<T>- Returns:
- the number of times this scenario has been successfully run
-
unsuccessfulRunCount
public final int unsuccessfulRunCount()- Specified by:
unsuccessfulRunCountin interfaceUsageScenario<T>- Returns:
- the number of times this scenario has been unsuccessfully run
-
totalRunCount
public final int totalRunCount()- Specified by:
totalRunCountin interfaceUsageScenario<T>- Returns:
- the total number of times this scenario has been run
-
exceptions
- Specified by:
exceptionsin interfaceUsageScenario<T>- Returns:
- any exceptions that have occurred during a run
-
resetRunCount
public final void resetRunCount()Description copied from interface:UsageScenarioResets the run counters- Specified by:
resetRunCountin interfaceUsageScenario<T>
-
clearExceptions
public final void clearExceptions()Description copied from interface:UsageScenarioClears the exceptions that have been collected so far- Specified by:
clearExceptionsin interfaceUsageScenario<T>
-
toString
-
run
Description copied from interface:UsageScenarioRuns this scenario with the given application- Specified by:
runin interfaceUsageScenario<T>- Parameters:
application- the application to use- Returns:
- the run result
-
hashCode
public final int hashCode() -
equals
-
defaultWeight
public int defaultWeight()- Specified by:
defaultWeightin interfaceUsageScenario<T>- Returns:
- the default weight for this scenario, 1 by default
-
perform
Runs a set of actions on the given application.- Parameters:
application- the application- Throws:
Exception- in case of an exception
-
prepare
Called before this scenario is run, override to prepare the application for each run- Parameters:
application- the application
-
cleanup
Called after this scenario has been run, override to clean up the application after each run- Parameters:
application- the application
-