01: package abbot.script;
02:
03: import abbot.finder.Hierarchy;
04:
05: /** Provides generic support to set up and tear down a UI context or
06: * fixture.
07: */
08: public interface UIContext {
09: /** @return A {@link ClassLoader} providing access to classes in this
10: * context.
11: */
12: ClassLoader getContextClassLoader();
13:
14: /** Launch this context. If any <code>UIContext</code> is extant,
15: * this <code>UIContext</code> should terminate it before launching.
16: * If this context is already launched, this method
17: * should do nothing.
18: */
19: void launch(StepRunner runner) throws Throwable;
20:
21: /** @return Whether this <code>UIContext</code> is currently launched. */
22: boolean isLaunched();
23:
24: /** Terminate this context. All UI components found in the
25: * {@link Hierarchy} returned by {@link #getHierarchy()}
26: * will be disposed.
27: */
28: void terminate();
29:
30: /** @return Whether this <code>UIContext</code> is equivalent to another. */
31: boolean equivalent(UIContext context);
32:
33: /** A context must maintain the same {@link Hierarchy} for the lifetime of
34: * the fixture.
35: */
36: public Hierarchy getHierarchy();
37: }
|