| java.lang.Object abbot.script.Step abbot.script.Call abbot.script.PropertyCall abbot.script.Assert
Assert | public class Assert extends PropertyCall (Code) | | Encapsulate an assertion (or a wait). Usage:
<assert method="[!]assertXXX" args="..." [class="..."]>
<assert method="[!](get|is|has)XXX" component="component_id" value="...">
<assert method="[!]XXX" args="..." class="...">
<wait ... [timeout="..."] [pollInterval="..."]>
The first example above invokes a core assertion provided by the
abbot.tester.ComponentTester class; the class tag is required for
assertions based on a class derived from
abbot.tester.ComponentTester ; the class tag indicates the
java.awt.Component class, not the Tester class (the appropriate
tester class will be derived automatically).
The second format indicates a property check on the given component, and an
expected value must be provided; the method name must start with "is",
"get", or "has". Finally, any arbitrary static boolean method may be used
in the assertion; you must specify the class and arguments.
You can invert the sense of either form of assertion by inserting a '!'
character before the method name, or adding an invert="true"
attribute.
The default timeout for a wait is ten seconds; the default poll interval
(sleep time between checking the assertion) is 1/10 second. Both may be
set as XML attributes (pollInterval and timeout ).
|
Field Summary | |
final public static int | DEFAULT_INTERVAL Default interval between checking the assertion in a wait. | final public static int | DEFAULT_TIMEOUT Default timeout before a wait will indicate failure. |
Constructor Summary | |
public | Assert(Resolver resolver, Map attributes) Construct an assert step from XML. | public | Assert(Resolver resolver, String desc, String targetClassName, String methodName, String[] args, String expectedResult, boolean invert) Assertion provided by the ComponentTester class, or an arbitrary
static call. | public | Assert(Resolver resolver, String desc, String methodName, String[] args, Class testedClass, String expectedResult, boolean invert) Assertion provided by a ComponentTester subclass which operates on a
Component subclass. | public | Assert(Resolver resolver, String desc, String methodName, String componentID, String expectedResult, boolean invert) Property assertion on Component subclass. |
DEFAULT_INTERVAL | final public static int DEFAULT_INTERVAL(Code) | | Default interval between checking the assertion in a wait.
|
DEFAULT_TIMEOUT | final public static int DEFAULT_TIMEOUT(Code) | | Default timeout before a wait will indicate failure.
|
Assert | public Assert(Resolver resolver, Map attributes)(Code) | | Construct an assert step from XML.
|
Assert | public Assert(Resolver resolver, String desc, String targetClassName, String methodName, String[] args, String expectedResult, boolean invert)(Code) | | Assertion provided by the ComponentTester class, or an arbitrary
static call.
|
Assert | public Assert(Resolver resolver, String desc, String methodName, String[] args, Class testedClass, String expectedResult, boolean invert)(Code) | | Assertion provided by a ComponentTester subclass which operates on a
Component subclass.
|
evaluateAssertion | protected void evaluateAssertion() throws Throwable(Code) | | Check the assertion.
|
getAttributes | public Map getAttributes()(Code) | | |
getDefaultDescription | public String getDefaultDescription()(Code) | | |
getPollInterval | public long getPollInterval()(Code) | | |
getTimeout | public long getTimeout()(Code) | | |
isInverted | public boolean isInverted()(Code) | | |
isWait | public boolean isWait()(Code) | | |
setExpectedResult | public void setExpectedResult(String result)(Code) | | |
setInverted | public void setInverted(boolean invert)(Code) | | |
setPollInterval | public void setPollInterval(long interval)(Code) | | |
setTimeout | public void setTimeout(long timeout)(Code) | | |
|
|