01: package abbot.script;
02:
03: import java.awt.Component;
04: import java.util.Collection;
05: import java.io.File;
06:
07: import abbot.finder.Hierarchy;
08:
09: // TODO: extract reference management
10: // o hierarchy
11: // o refs collection
12: // o name generation
13:
14: /** Interface to provide a general context in which tests are run.
15: * Includes ComponentReferences, current gui hierarchy, properties, and a
16: * working directory.
17: */
18: public interface Resolver {
19: /** Return the existing reference for the given component, or null if none
20: exists. */
21: ComponentReference getComponentReference(Component comp);
22:
23: /** Add a new component to the existing collection. */
24: ComponentReference addComponent(Component comp);
25:
26: /** Add a new component reference to the existing collection. */
27: void addComponentReference(ComponentReference ref);
28:
29: /** Returns a collection of all the existing references. */
30: Collection getComponentReferences();
31:
32: /** Return the ComponentReference matching the given id, or null if none
33: exists. */
34: ComponentReference getComponentReference(String refid);
35:
36: /** Get Hierarchy used by this Resolver. */
37: Hierarchy getHierarchy();
38:
39: /** Return the class loader for use in this context. */
40: ClassLoader getContextClassLoader();
41:
42: /** Provide a working directory context for relative pathnames. */
43: File getDirectory();
44:
45: /** Provide temporary storage of String values. */
46: void setProperty(String name, Object value);
47:
48: /** Provide retrieval of values from temporary storage. */
49: Object getProperty(String name);
50:
51: /** Provide a human-readable string that describes the given step's
52: context.
53: */
54: // TODO: this belongs in UIContext
55: String getContext(Step step);
56: }
|