|
|
|
Artima SuiteRunner |
Why |
Getting Started |
Tutorial |
Get Help |
Discuss |
Print |
Email |
First Page |
Previous |
Next
|
Suite Execution by Overriding execute
|
Advertisement
|
Class ScriptDrivenAccountSuite contains two private instance variables:
scriptFileName -- the path name of the script file containing the test commands to execute
account -- the current Account instance, created for the most recent newAccount
command, on which the deposit, withdraw, and getBalance commands will operate.
Here are ScriptDrivenAccountSuite's instance variables:
public class ScriptDrivenAccountSuite extends Suite {
private static String DEFAULT_SCRIPT_FILE = "script.txt";
private static String scriptFileName;
private Account account = new Account();
ScriptDrivenAccountSuite's no-arg constructor sets the scriptFileName to the value
of the system property ScriptFile. If ScriptFile is not set, the constructor initializes
scriptFileName to its default: "script.txt".
Here's ScriptDrivenAccountSuite's no-arg constructor:
/**
* Construct a new <code>ScriptDrivenAccountSuite</code>. If
* the <code>ScriptFile</code> system property is set, the
* value of that property will be used as the script file
* name. Else, <code>script.txt</code> will be used.
*/
public ScriptDrivenAccountSuite() {
scriptFileName = System.getProperty("ScriptFile");
if (scriptFileName == null) {
scriptFileName = DEFAULT_SCRIPT_FILE;
}
}
|
Sponsored Links
|