|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.client.test.CommandRunner
com.funambol.client.test.BasicScriptRunner
public class BasicScriptRunner
The CommandRunner container implementation to run commands that are common to all the clients. This is not only a CommandRunner object itself, but also a container for any other command runner used by the given client test suite. refer to this class using the basic contructor, but remember to add explicitly implemented command runners in order to extend the command pool available to the tester. Use addcommandRunner(CommandRunner) method to achieve this goal. If no commad runner are added, no command will be effective and the run of the test suite will be unuseful. This class uses a CheckSyncClient object, a SyncMonitor and an AuthSyncMonitor to check that the requested sync operations went fine both on the client and the server side.
Field Summary | |
---|---|
protected int |
errorCode
|
Fields inherited from class com.funambol.client.test.CommandRunner |
---|
authSyncMonitor, checkSyncClient, robot, syncMonitor |
Constructor Summary | |
---|---|
BasicScriptRunner()
Default constructor |
Method Summary | |
---|---|
void |
addCommandRunner(CommandRunner runner)
Add a specific CommandRunner implementation to the current BasicScriptRunner instance |
protected boolean |
checkCandidateStatement(java.lang.String command,
boolean onExecuted)
Check the candidate statement to be executed given a conditional command |
static HttpTransportAgent |
createTestTransportAgent(SyncConfig config)
|
static java.lang.String |
getBaseUrl()
|
protected java.lang.String |
getBaseUrl(java.lang.String scriptUrl)
Get the script related base url |
int |
getErrorCode()
Accessor method to retrieve the global status of the entire test suite. |
protected java.lang.String |
getOsVersion()
Accessor method to retrieve the OS version |
java.lang.String |
getResults()
Accessor method to retrieve the details of the failed tests |
boolean |
runCommand(java.lang.String command,
java.lang.String pars)
Checks the given command runner in order to execute the given command with the given arguments. |
void |
runScript(java.lang.String script,
java.lang.String scriptUrl)
Execute the given script by interpreting it |
void |
runScriptFile(java.lang.String scriptUrl,
boolean mainScript)
This method is responsible to interprete the file (being it on the device storage or taken via http), interpreting and running the commands defined by the tester. |
void |
setAuthSyncMonitor(SyncMonitor monitor)
Set the AuthSyncMonitor object for this CommandRunner container |
void |
setCheckSyncClient(CheckSyncClient client)
Set the CheckSyncClient object for this CommandRunner container |
void |
setErrorCode(int errorCode)
Accessor method to set the global suite error code from outside (external syntax error) |
void |
setStopOnFailure(boolean stop)
Tells if the script runner shall be interrupted at the first failure |
void |
setSyncMonitor(SyncMonitor monitor)
Set the SyncMonitor object for this CommandRunner container |
Methods inherited from class com.funambol.client.test.CommandRunner |
---|
checkArgument, checkObject, getParameter, getParametersCount, parseBoolean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int errorCode
Constructor Detail |
---|
public BasicScriptRunner()
Method Detail |
---|
public void addCommandRunner(CommandRunner runner)
runner
- th CommandRunner object to be added.public static java.lang.String getBaseUrl()
public void runScriptFile(java.lang.String scriptUrl, boolean mainScript) throws java.lang.Throwable
scriptUrl
- the script url String formattedmainScript
- boolean to declare that this is a main test script
(not yet in use)
java.lang.Throwable
- if an error occurred while retrieving a script content.
This is the only case in which the test suite is entirely aborted.public void runScript(java.lang.String script, java.lang.String scriptUrl) throws java.lang.Throwable
java.lang.Throwable
public void setStopOnFailure(boolean stop)
stop
- public boolean runCommand(java.lang.String command, java.lang.String pars) throws java.lang.Throwable
runCommand
in class CommandRunner
command
- the String formatted command to be passed to the runners
arraypars
- the command's parameter.
java.lang.Throwable
- if an error occurred executing the command.public int getErrorCode()
public void setErrorCode(int errorCode)
errorCode
- the int representation of the error codepublic java.lang.String getResults()
protected java.lang.String getOsVersion()
protected boolean checkCandidateStatement(java.lang.String command, boolean onExecuted) throws java.lang.Throwable
command
- the conditional statement commandonExecuted
- tries to predict the condition set in the command
java.lang.Throwable
- if an error occurs.protected java.lang.String getBaseUrl(java.lang.String scriptUrl)
scriptUrl
- the String formatted script url
public void setSyncMonitor(SyncMonitor monitor)
setSyncMonitor
in class CommandRunner
monitor
- the SyncMonitor to be setpublic void setAuthSyncMonitor(SyncMonitor monitor)
setAuthSyncMonitor
in class CommandRunner
monitor
- the AuthSyncMonitor to be setpublic void setCheckSyncClient(CheckSyncClient client)
setCheckSyncClient
in class CommandRunner
client
- the CheckSyncClient to be setpublic static HttpTransportAgent createTestTransportAgent(SyncConfig config)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |