Package org.mozilla.zest.core.v1
Interface ZestRunner
-
- All Known Implementing Classes:
ZestBasicRunner
public interface ZestRunnerThe Interface ZestRunner.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetStopOnAssertFail()Gets the stop on assert fail.booleangetStopOnTestFail()Gets the stop on test fail.StringgetVariable(String name)Gets the variable.Map<String,String>getVariables()Gets the variables.StringhandleAction(ZestScript script, ZestAction action, ZestResponse lastResponse)Handle action.StringhandleAssignment(ZestScript script, ZestAssignment assign, ZestResponse lastResponse)Handle an assignment.StringhandleClient(ZestScript script, ZestClient client)ZestResponsehandleLoop(ZestScript script, ZestLoop<?> loop, ZestResponse lastResponse)voidhandleResponse(ZestRequest request, ZestResponse response)Handle response.booleanisDebug()Reports if debugging is enabledvoidresponseFailed(ZestRequest request, ZestResponse response)Response failed.voidresponseFailed(ZestRequest request, ZestResponse response, ZestAssertion assertion)Response failed.voidresponsePassed(ZestRequest request, ZestResponse response)Response passed.voidresponsePassed(ZestRequest request, ZestResponse response, ZestAssertion assertion)Response passed.Stringrun(ZestScript script, Map<String,String> params)Run.Stringrun(ZestScript script, ZestRequest target, Map<String,String> params)Run.StringrunScript(Reader reader, Map<String,String> params)Run script.StringrunScript(String script, Map<String,String> params)Run script.ZestResponserunStatement(ZestScript script, ZestStatement stmt, ZestResponse lastResponse)Run statement.ZestResponsesend(ZestRequest request)Send.voidsetDebug(boolean debug)Turns debugging on or offvoidsetOutputWriter(Writer writer)Sets the output writer.voidsetScriptEngineFactory(ScriptEngineFactory factory)voidsetStopOnAssertFail(boolean stop)Sets the stop on assert fail.voidsetStopOnTestFail(boolean stop)Sets the stop on test fail.voidsetVariable(String name, String value)Sets the variable.
-
-
-
Method Detail
-
run
String run(ZestScript script, Map<String,String> params) throws ZestAssertFailException, ZestActionFailException, IOException, ZestInvalidCommonTestException, ZestAssignFailException, ZestClientFailException
Run.- Parameters:
script- the script- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exceptionIOException- Signals that an I/O exception has occurred.ZestInvalidCommonTestException- the zest invalid common test exceptionZestAssignFailException- the zest assign fail exceptionZestClientFailException
-
runScript
String runScript(Reader reader, Map<String,String> params) throws ZestAssertFailException, ZestActionFailException, IOException, ZestInvalidCommonTestException, ZestAssignFailException, ZestClientFailException
Run script.- Parameters:
reader- the reader- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exceptionIOException- Signals that an I/O exception has occurred.ZestInvalidCommonTestException- the zest invalid common test exceptionZestAssignFailException- the zest assign fail exceptionZestClientFailException
-
runScript
String runScript(String script, Map<String,String> params) throws ZestAssertFailException, ZestActionFailException, IOException, ZestInvalidCommonTestException, ZestAssignFailException, ZestClientFailException
Run script.- Parameters:
script- the script- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exceptionIOException- Signals that an I/O exception has occurred.ZestInvalidCommonTestException- the zest invalid common test exceptionZestAssignFailException- the zest assign fail exceptionZestClientFailException
-
run
String run(ZestScript script, ZestRequest target, Map<String,String> params) throws ZestAssertFailException, ZestActionFailException, IOException, ZestInvalidCommonTestException, ZestAssignFailException, ZestClientFailException
Run.- Parameters:
script- the scripttarget- the target- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exceptionIOException- Signals that an I/O exception has occurred.ZestInvalidCommonTestException- the zest invalid common test exceptionZestAssignFailException- the zest assign fail exceptionZestClientFailException
-
runStatement
ZestResponse runStatement(ZestScript script, ZestStatement stmt, ZestResponse lastResponse) throws ZestAssertFailException, ZestActionFailException, IOException, ZestInvalidCommonTestException, ZestAssignFailException, ZestClientFailException
Run statement.- Parameters:
script- the scriptstmt- the stmtlastResponse- the last response- Returns:
- the zest response
- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exceptionIOException- Signals that an I/O exception has occurred.ZestInvalidCommonTestException- the zest invalid common test exceptionZestAssignFailException- the zest assign fail exceptionZestClientFailException
-
send
ZestResponse send(ZestRequest request) throws IOException
Send.- Parameters:
request- the request- Returns:
- the zest response
- Throws:
IOException- Signals that an I/O exception has occurred.
-
handleResponse
void handleResponse(ZestRequest request, ZestResponse response) throws ZestAssertFailException, ZestActionFailException
Handle response.- Parameters:
request- the requestresponse- the response- Throws:
ZestAssertFailException- the zest assert fail exceptionZestActionFailException- the zest action fail exception
-
handleAction
String handleAction(ZestScript script, ZestAction action, ZestResponse lastResponse) throws ZestActionFailException
Handle action.- Parameters:
script- the scriptaction- the actionlastResponse- the last response- Returns:
- the string
- Throws:
ZestActionFailException- the zest action fail exception
-
handleAssignment
String handleAssignment(ZestScript script, ZestAssignment assign, ZestResponse lastResponse) throws ZestAssignFailException
Handle an assignment.- Parameters:
script- the scriptassign- the assignmentlastResponse- the last response- Returns:
- the string
- Throws:
ZestAssignFailException- the zest assignment fail exception
-
handleLoop
ZestResponse handleLoop(ZestScript script, ZestLoop<?> loop, ZestResponse lastResponse) throws ZestAssertFailException, ZestActionFailException, ZestInvalidCommonTestException, IOException, ZestAssignFailException, ZestClientFailException
-
handleClient
String handleClient(ZestScript script, ZestClient client) throws ZestClientFailException
- Throws:
ZestClientFailException
-
responsePassed
void responsePassed(ZestRequest request, ZestResponse response, ZestAssertion assertion)
Response passed.- Parameters:
request- the requestresponse- the responseassertion- the assertion
-
responseFailed
void responseFailed(ZestRequest request, ZestResponse response, ZestAssertion assertion) throws ZestAssertFailException
Response failed.- Parameters:
request- the requestresponse- the responseassertion- the assertion- Throws:
ZestAssertFailException- the zest assert fail exception
-
responsePassed
void responsePassed(ZestRequest request, ZestResponse response)
Response passed.- Parameters:
request- the requestresponse- the response
-
responseFailed
void responseFailed(ZestRequest request, ZestResponse response) throws ZestAssertFailException
Response failed.- Parameters:
request- the requestresponse- the response- Throws:
ZestAssertFailException- the zest assert fail exception
-
setStopOnAssertFail
void setStopOnAssertFail(boolean stop)
Sets the stop on assert fail.- Parameters:
stop- the new stop on assert fail
-
setStopOnTestFail
void setStopOnTestFail(boolean stop)
Sets the stop on test fail.- Parameters:
stop- the new stop on test fail
-
getStopOnAssertFail
boolean getStopOnAssertFail()
Gets the stop on assert fail.- Returns:
- the stop on assert fail
-
getStopOnTestFail
boolean getStopOnTestFail()
Gets the stop on test fail.- Returns:
- the stop on test fail
-
setOutputWriter
void setOutputWriter(Writer writer)
Sets the output writer.- Parameters:
writer- the new output writer
-
setDebug
void setDebug(boolean debug)
Turns debugging on or off- Parameters:
debug-
-
isDebug
boolean isDebug()
Reports if debugging is enabled- Returns:
trueif debug is enabled,falseotherwise.
-
getVariable
String getVariable(String name)
Gets the variable.- Parameters:
name- the name- Returns:
- the variable
-
setVariable
void setVariable(String name, String value)
Sets the variable.- Parameters:
name- the namevalue- the value
-
getVariables
Map<String,String> getVariables()
Gets the variables.- Returns:
- a map with variables' name to value.
- Since:
- 0.14.0
-
setScriptEngineFactory
void setScriptEngineFactory(ScriptEngineFactory factory)
-
-