abbot.script
Class Fixture

java.lang.Object
  extended by abbot.script.Step
      extended by abbot.script.Sequence
          extended by abbot.script.Script
              extended by abbot.script.Fixture
All Implemented Interfaces:
Resolver, UIContext, XMLConstants, XMLifiable, Serializable

public class Fixture
extends Script
implements UIContext

Provides a method of defining a single script as the UI application test context for multiple scripts. A script which uses a fixture step (as opposed to an explicit launch) will only instantiate the fixture if it does not already exist.

A Fixture will only be run once for any consecutive group of Scripts that refer to it. The StepRunner class is normally used to control execution and will manage fixture setup/teardown as needed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class abbot.script.Script
INTERPRETER, UNTITLED, UNTITLED_FILE, validate
 
Fields inherited from interface abbot.script.XMLConstants
TAG_ACTION, TAG_APPLETVIEWER, TAG_ARCHIVE, TAG_ARGS, TAG_ASSERT, TAG_AWT, TAG_AWTTESTSCRIPT, TAG_BORDER_TITLE, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_CODE, TAG_CODEBASE, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_EXPR, TAG_FILENAME, TAG_FIXTURE, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ICON, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LABEL, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_ROOT, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_TEXT, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WEIGHTED, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y
 
Constructor Summary
Fixture(Resolver parent, Map attributes)
          Construct a Fixture from its XML attributes.
Fixture(String filename, Hierarchy h)
           
 
Method Summary
 boolean equivalent(UIContext f)
          Two fixtures are equivalent if they have the same XML representation.
 String getDefaultDescription()
          Return a default description for this Script.
 String getXMLTag()
          Define the XML tag to use for this script step.
 boolean isLaunched()
           
 void launch(StepRunner runner)
          Run the entire fixture, using the given runner as a controller/monitor.
protected  void runStep(StepRunner runner)
          Don't re-run if already launched.
 void terminate()
          Terminate this context.
 
Methods inherited from class abbot.script.Script
addComponent, addComponentReference, addComponentReference, addContent, addStep, addStep, changeFile, clear, countLines, createDefaultMap, getAttributes, getComponentReference, getComponentReference, getComponentReferences, getContext, getContextClassLoader, getDirectory, getFile, getFile, getFilename, getFullXMLString, getHierarchy, getLine, getName, getProperty, getRelativeTo, getUIContext, getUsage, getVMArgs, hasLaunch, hasTerminate, isAWTMode, isDirty, isForked, isScript, isSlowPlayback, load, load, parseAttributes, parseChild, resolveRelativeReferences, save, save, setAWTMode, setFile, setForked, setHierarchy, setProperty, setRelativeTo, setSlowPlayback, setStep, setVMArgs, toEditableString
 
Methods inherited from class abbot.script.Sequence
getStep, indexOf, parseChildren, removeStep, removeStep, runStep, size, steps
 
Methods inherited from class abbot.script.Step
addAttributes, createAttributeMap, createStep, createStep, getDescription, getResolver, parseStepAttributes, resolveClass, resolveTester, run, setDescription, setScriptError, simpleClassName, toString, toXML, toXMLString, usage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface abbot.script.UIContext
getContextClassLoader, getHierarchy
 

Constructor Detail

Fixture

public Fixture(String filename,
               Hierarchy h)

Fixture

public Fixture(Resolver parent,
               Map attributes)
Construct a Fixture from its XML attributes.

Method Detail

launch

public void launch(StepRunner runner)
            throws Throwable
Run the entire fixture, using the given runner as a controller/monitor.

Specified by:
launch in interface UIContext
Throws:
Throwable

isLaunched

public boolean isLaunched()
Specified by:
isLaunched in interface UIContext
Returns:
Whether this fixture is currently launched.

runStep

protected void runStep(StepRunner runner)
                throws Throwable
Don't re-run if already launched.

Overrides:
runStep in class Script
Throws:
Throwable

terminate

public void terminate()
Description copied from interface: UIContext
Terminate this context. All UI components found in the Hierarchy returned by UIContext.getHierarchy() will be disposed.

Specified by:
terminate in interface UIContext

getXMLTag

public String getXMLTag()
Description copied from class: Step
Define the XML tag to use for this script step.

Overrides:
getXMLTag in class Script

getDefaultDescription

public String getDefaultDescription()
Description copied from class: Script
Return a default description for this Script.

Overrides:
getDefaultDescription in class Script

equivalent

public boolean equivalent(UIContext f)
Two fixtures are equivalent if they have the same XML representation.

Specified by:
equivalent in interface UIContext
Returns:
Whether this UIContext is equivalent to another.


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge