|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--MicroTAPAS.ScriptHandler
Handles the execution of a script and logs the result for each executed command.
| Field Summary | |
private java.lang.String |
LF
|
java.util.Vector |
log
The log that contains all the results from executed commands. |
private ControlInterface |
parent
|
private java.lang.String[] |
script
|
private java.lang.String |
scriptFile
|
private boolean |
stopOnError
|
private java.lang.Thread |
thread
|
| Constructor Summary | |
ScriptHandler(ControlInterface pParent,
java.lang.String pScriptFile,
boolean pStopOnError)
Constructor |
|
| Method Summary | |
void |
clearLog()
Clears all test results from the action log. |
private void |
controlEcho(java.lang.String msg)
Method to print a message in parent baseFrame window- |
TestResult |
executeCommand(java.lang.String cmd,
java.lang.String[] args,
boolean expectSuccess,
long delay)
Executes one single command after a delay of 'delay' milliseconds. |
private Item |
listResult()
|
java.lang.String |
log2StringLong()
Converts the stored test results to a string. |
java.lang.String |
log2StringShort()
Converts the stored test results to a string, short format (one liners). |
TestResult |
logAction(java.lang.String cmd,
java.lang.String[] args,
boolean expectSuccess,
RequestResult rr,
long timeUsed)
Adds a TestResult to the action log |
private java.util.Vector |
parseLine(java.lang.String script)
Command to parse one script line into a vector of arguments used for execution. |
void |
run()
Starts the thread that executes a script |
private void |
runScript()
Runs a script located locally on the terminal. |
void |
startScript()
Starts the execution of the script. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final java.lang.String LF
private ControlInterface parent
private boolean stopOnError
private java.lang.String[] script
private java.lang.Thread thread
private java.lang.String scriptFile
public java.util.Vector log
| Constructor Detail |
public ScriptHandler(ControlInterface pParent,
java.lang.String pScriptFile,
boolean pStopOnError)
| Method Detail |
public void startScript()
public TestResult executeCommand(java.lang.String cmd,
java.lang.String[] args,
boolean expectSuccess,
long delay)
cmd - The TAPAS command to be executed.args - Any arguments to the command.expectSuccess - True if one expect the command to be executed successfully.delay - Delays the execution of the command by 'delay' milliseconds.
public void run()
run in interface java.lang.Runnableprivate void runScript()
private void controlEcho(java.lang.String msg)
msg - The message to be printed.private java.util.Vector parseLine(java.lang.String script)
script - One line of arguments
private Item listResult()
public TestResult logAction(java.lang.String cmd,
java.lang.String[] args,
boolean expectSuccess,
RequestResult rr,
long timeUsed)
cmd - The command that was executedargs - The command argumentsexpectSuccess - Indicates if the command was expected to be successfulrr - The RequestResult of the executed commandtimeUsed - The time used to executed the command (in milliseconds)public void clearLog()
public java.lang.String log2StringLong()
public java.lang.String log2StringShort()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||