Interface TestScriptActionInterface
- All Known Implementing Classes:
RecordScriptTestInterface
public interface TestScriptActionInterface
Interface to be implemented by script-running actions, if they want to allow
themselves to be used for user-testing of their script.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
execute
(TestScriptInput input, TestScriptOutput output) Execute a test script.Define the list of input fields for testing the script.Define the list of output fields when testing the script.default Serializable
processTestScriptOutput
(ExecuteCodeOutput executeCodeOutput) Called to adapt or translate the output object of the script execution to something suitable for returning to the caller.void
setupTestScriptInput
(TestScriptInput testScriptInput, ExecuteCodeInput executeCodeInput) Called to adapt or translate data from the TestScriptInput (which would just have a map of name-value pairs) to the actual input object(s) used by the script.
-
Method Details
-
setupTestScriptInput
void setupTestScriptInput(TestScriptInput testScriptInput, ExecuteCodeInput executeCodeInput) throws QException Called to adapt or translate data from the TestScriptInput (which would just have a map of name-value pairs) to the actual input object(s) used by the script. Note - such a method may want or need to put an "output" object into the executeCodeInput's context map.- Throws:
QException
-
processTestScriptOutput
Called to adapt or translate the output object of the script execution to something suitable for returning to the caller. Default implementation may always be suitable? -
getTestInputFields
List<QFieldMetaData> getTestInputFields()Define the list of input fields for testing the script. The names of these fields will end up as keys in the setupTestScriptInput method's testScriptInput object. -
getTestOutputFields
List<QFieldMetaData> getTestOutputFields()Define the list of output fields when testing the script. The output object returned from processTestScriptOutput should have keys that match these field names. -
execute
Execute a test script.- Throws:
QException
-