| |
|
| java.lang.Object java.lang.Thread org.netbeans.jemmy.ActionProducer org.netbeans.jemmy.Test
All known Subclasses: org.netbeans.jemmy.testing.JemmyTest,
Test | public class Test extends ActionProducer implements Timeoutable,Outputable,Scenario(Code) | | Jemmy itself provides a way to create tests.
Test should implement org.netbeans.jemmy.Scenario interface.
Test can be executed from command line:
java [application options] [jemmy options] org.netbeans.jemmy.Test [full name of test class] [test args]
Test elso can be executed by one of the run(...) methods or by
new Test([test class name]).startTest([test args]);
Timeouts used:
Test.WholeTestTimeout - time for the whole test
author: Alexandre Iline (alexandre.iline@sun.com) |
Constructor Summary | |
public | Test(String testClassName) Constructor for tests requiring only a class instance. | public | Test(Scenario scenario) Constructor for scenarios that require an instance and might require an argument. | protected | Test() No argument constructor. |
Method Summary | |
public static void | closeDown(int status) Throws TestCompletedException exception. | protected void | doSleep(long time) Sleeps. | final public String | getDescription() | public TestOut | getOutput() Get the streams or writers used for print output. | public Timeouts | getTimeouts() Get the timeouts used by this Test . | final public Object | launch(Object obj) Launch an action. | public static void | main(String[] argv) Invoke this Test . | public void | printSynopsis() Supposed to be overridden to print a synopsys into test output. | public static int | run(String[] argv) Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. | public static int | run(String[] argv, PrintStream output) Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Stream to put test output and errput into. | public static int | run(String[] argv, PrintStream output, PrintStream errput) Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Stream to put test output into. Parameters: errput - Stream to put test errput into. | public static int | run(String[] argv, PrintWriter output) Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Writer to put test output and errput into. | public static int | run(String[] argv, PrintWriter output, PrintWriter errput) Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Writer to put test output into. Parameters: errput - Writer to put test errput into. | public int | runIt(Object param) Defines a way to execute this Test .
Parameters: param - An object passed to configure the test scenarioexecution. | public void | setOutput(TestOut out) Set the streams or writers used for print output. | public void | setTimeouts(Timeouts timeouts) Set the timeouts used by this Test . | public int | startTest(Object param) Executes test.
Parameters: param - Object to be passed into this test's launch(Object) method. | public Scenario | testForName(String testName) Creates an instance of a class named by the parameter. |
SCENARIO_EXCEPTION_STATUS | public static int SCENARIO_EXCEPTION_STATUS(Code) | | Status returned by test if exception appeared inside scenario.
|
TEST_PASSED_STATUS | public static int TEST_PASSED_STATUS(Code) | | Positive test status.
|
WRONG_PARAMETERS_STATUS | public static int WRONG_PARAMETERS_STATUS(Code) | | Status returned by test if wrong parameter was passed.
|
Test | public Test(String testClassName)(Code) | | Constructor for tests requiring only a class instance.
Creates a subclass of ActionProducer and java.lang.Thread
that runs in a separate thread of execution and waits for execution to finish.
The current output stream assignments and timeouts are used.
Parameters: testClassName - Full test class name |
Test | public Test(Scenario scenario)(Code) | | Constructor for scenarios that require an instance and might require an argument.
Creates a subclass of ActionProducer and java.lang.Thread
that runs in a separate thread of execution and waits for execution to finish.
The current output stream assignments and timeouts are used.
Parameters: scenario - a test scenario See Also: org.netbeans.jemmy.Scenario |
Test | protected Test()(Code) | | No argument constructor.
Used by subclasses of this Test class.
Creates a subclass of ActionProducer and java.lang.Thread
that runs in a separate thread of execution and waits for execution to finish.
The current output stream assignments and timeouts are used.
|
closeDown | public static void closeDown(int status)(Code) | | Throws TestCompletedException exception.
The exception thrown contains a pass/fail status and a short
status java.lang.String .
Can by invoked from test to abort test execution.
Parameters: status - If 0 - test passed, otherwise failed. throws: TextCompletedException - all of the time. |
doSleep | protected void doSleep(long time)(Code) | | Sleeps.
Parameters: time - The sleep time in milliseconds. |
launch | final public Object launch(Object obj)(Code) | | Launch an action.
Pass arguments to and execute a test Scenario .
Parameters: obj - An argument object that controls test execution.This might be a java.lang.String[] containingcommand line arguments. See Also: org.netbeans.jemmy.Action an Integer containing test status. |
main | public static void main(String[] argv)(Code) | | Invoke this Test .
The call might be directly from the command line.
Parameters: argv - First element should be a test class name,all others - test args. |
printSynopsis | public void printSynopsis()(Code) | | Supposed to be overridden to print a synopsys into test output.
|
run | public static int run(String[] argv)(Code) | | Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. test status. |
run | public static int run(String[] argv, PrintStream output)(Code) | | Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Stream to put test output and errput into. test status. |
run | public static int run(String[] argv, PrintStream output, PrintStream errput)(Code) | | Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Stream to put test output into. Parameters: errput - Stream to put test errput into. test status. |
run | public static int run(String[] argv, PrintWriter output)(Code) | | Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Writer to put test output and errput into. test status. |
run | public static int run(String[] argv, PrintWriter output, PrintWriter errput)(Code) | | Executes a test.
Parameters: argv - First element should be a test class name,all others - test args. Parameters: output - Writer to put test output into. Parameters: errput - Writer to put test errput into. test status. |
runIt | public int runIt(Object param)(Code) | | Defines a way to execute this Test .
Parameters: param - An object passed to configure the test scenarioexecution. For example, this parameter might be ajava.lang.String[] object that lists thecommand line arguments to the Java application correspondingto a test. an int that tells something about the execution.For, example, a status code. See Also: org.netbeans.jemmy.Scenario |
startTest | public int startTest(Object param)(Code) | | Executes test.
Parameters: param - Object to be passed into this test's launch(Object) method. test status. |
testForName | public Scenario testForName(String testName)(Code) | | Creates an instance of a class named by the parameter.
Parameters: testName - Full test class name an instance of the test Scenario to launch. See Also: org.netbeans.jemmy.Scenario |
|
|
|