01: package abbot.editor.recorder;
02:
03: import java.awt.Frame;
04:
05: import javax.swing.JLabel;
06:
07: import junit.extensions.abbot.RepeatHelper;
08: import abbot.script.Resolver;
09: import abbot.tester.FrameTester;
10:
11: /**
12: * Unit test to verify proper capture of user semantic events on a Frame.
13: */
14: public class FrameRecorderTest extends AbstractSemanticRecorderFixture {
15:
16: private FrameTester tester;
17:
18: public FrameRecorderTest(String name) {
19: super (name);
20: }
21:
22: protected void setUp() throws Exception {
23: super .setUp();
24: tester = new FrameTester();
25: }
26:
27: protected SemanticRecorder createSemanticRecorder(Resolver r) {
28: return new FrameRecorder(r);
29: }
30:
31: public void testNoCaptureResize() {
32: final Frame f = new Frame(getName());
33: f.add(new JLabel(getName()));
34: f.setResizable(false);
35: showWindow(f);
36: startRecording();
37: tester.resize(f, f.getWidth() * 2, f.getHeight());
38: assertNoStep();
39: }
40:
41: public static void main(String[] args) {
42: RepeatHelper.runTests(args, FrameRecorderTest.class);
43: }
44: }
|