public abstract class AbstractScriptBuilder
extends java.lang.Object
Provides the shared implementation among all execution step builders. This also defines the minimum API set that all builders must implement.
| Modifier and Type | Method and Description |
|---|---|
org.threadly.concurrent.future.ListenableFuture<java.lang.Double> |
addProgressFuture()
Adds a step in the current test position which will log out the percent of completion for the
entire test script.
|
abstract void |
addStep(ScriptStep step)
Add a step to this builder.
|
void |
addSteps(AbstractScriptBuilder scriptBuilder)
Adds steps for an unknown builder type.
|
abstract void |
addSteps(ParallelScriptBuilder parallelSteps)
Add a parallel series of steps to this builder.
|
abstract void |
addSteps(SequentialScriptBuilder sequentialSteps)
Add a sequential series of steps to this builder.
|
ExecutableScript |
build()
Finalizes the script and compiles into an executable form.
|
int |
getMaximumNeededThreadCount()
Call to check how many threads this script will need to execute at the current build point.
|
abstract boolean |
hasSteps()
Checks if the builder has had at least one step added to it.
|
abstract AbstractScriptBuilder |
makeCopy()
Make a copy of the script chain.
|
void |
setMaxScriptStepRate(double stepsPerSecondLimit)
Sets a new limit for the script steps to be executed at.
|
public org.threadly.concurrent.future.ListenableFuture<java.lang.Double> addProgressFuture()
FutureCallback to the returned future.
If there are steps running in parallel at the time of execution for this progress future it
should be noted the number is a best guess, as no locking occurs during determining the
current progress.
If the script is stopped (likely due to an error or step failure), this returned future will
complete in an error state (ie Future.get() will throw a
ExecutionException.public void setMaxScriptStepRate(double stepsPerSecondLimit)
stepsPerSecondLimit - Steps per second allowed to executepublic abstract boolean hasSteps()
false
then this builder is effectively a no-op.true if at least one step is attached to this builderpublic abstract void addStep(ScriptStep step)
SequentialScriptBuilder.addStep(ScriptStep) and
ParallelScriptBuilder.addStep(ScriptStep).step - Test step to add to builderpublic abstract void addSteps(SequentialScriptBuilder sequentialSteps)
SequentialScriptBuilder.addSteps(SequentialScriptBuilder) and
ParallelScriptBuilder.addSteps(SequentialScriptBuilder).sequentialSteps - Script steps to be added to this builderpublic abstract void addSteps(ParallelScriptBuilder parallelSteps)
SequentialScriptBuilder.addSteps(SequentialScriptBuilder) and
ParallelScriptBuilder.addSteps(SequentialScriptBuilder).parallelSteps - Script steps to be added to this builderpublic void addSteps(AbstractScriptBuilder scriptBuilder)
addSteps(ParallelScriptBuilder) or addSteps(SequentialScriptBuilder).scriptBuilder - Script builder to add steps frompublic int getMaximumNeededThreadCount()
public abstract AbstractScriptBuilder makeCopy()
public ExecutableScript build()