Package com.valhalla.sdk.testing
Class OfflineScriptHarness
java.lang.Object
com.valhalla.sdk.testing.OfflineScriptHarness
- All Implemented Interfaces:
AutoCloseable
Runs one script lifecycle deterministically in an offline JVM test.
-
Constructor Summary
ConstructorsConstructorDescriptionOfflineScriptHarness(AbstractScript script, ScriptContext context) Creates a harness for one script and one fixture context. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops a started harness when used with try-with-resources.longloopOnce()Calls one loop and returns the script's requested delay.voidstart()CallsAbstractScript.onStart(ScriptContext)exactly once.voidstop()CallsAbstractScript.onStop(ScriptContext)exactly once after start.
-
Constructor Details
-
OfflineScriptHarness
Creates a harness for one script and one fixture context.
-
-
Method Details
-
start
public void start()CallsAbstractScript.onStart(ScriptContext)exactly once. -
loopOnce
public long loopOnce()Calls one loop and returns the script's requested delay. -
stop
public void stop()CallsAbstractScript.onStop(ScriptContext)exactly once after start. -
close
public void close()Stops a started harness when used with try-with-resources.- Specified by:
closein interfaceAutoCloseable
-