01: package junit.extensions.abbot;
02:
03: import java.awt.Window;
04: import java.util.Iterator;
05:
06: import junit.framework.TestCase;
07: import abbot.Log;
08: import abbot.finder.BasicFinder;
09: import abbot.script.Resolver;
10: import abbot.script.Script;
11:
12: /** Simple wrapper for testing objects which require a Resolver. */
13:
14: public abstract class ResolverFixture extends ComponentTestFixture {
15:
16: private Resolver resolver;
17:
18: /** Obtain a consistent resolver. */
19: protected Resolver getResolver() {
20: return resolver;
21: }
22:
23: /** Fixture setup is performed here, to avoid problems should a derived
24: class define its own setUp and neglect to invoke the superclass
25: method.
26: */
27: protected void fixtureSetUp() throws Throwable {
28: super .fixtureSetUp();
29: // FIXME kind of a hack, but Script is the only implementation of
30: // Resolver we've got at the moment.
31: resolver = new Script(getHierarchy());
32: }
33:
34: /** Fixture teardown is performed here, to avoid problems should a derived
35: class define its own tearDown and neglect to invoke the superclass
36: method.
37: */
38: protected void fixtureTearDown() throws Throwable {
39: super .fixtureTearDown();
40: resolver = null;
41: }
42:
43: /** Construct a test case with the given name. */
44: public ResolverFixture(String name) {
45: super (name);
46: }
47:
48: /** Default Constructor. The name will be automatically set from the
49: selected test method.
50: */
51: public ResolverFixture() {
52: }
53: }
|