01: package abbot.editor.recorder;
02:
03: import java.awt.*;
04:
05: import javax.swing.JLabel;
06:
07: import junit.extensions.abbot.RepeatHelper;
08: import abbot.script.Resolver;
09: import abbot.tester.DialogTester;
10:
11: /**
12: * Unit test to verify proper capture of user semantic events on a Dialog.
13: */
14: public class DialogRecorderTest extends AbstractSemanticRecorderFixture {
15:
16: private DialogTester tester;
17:
18: public DialogRecorderTest(String name) {
19: super (name);
20: }
21:
22: protected void setUp() throws Exception {
23: super .setUp();
24: tester = new DialogTester();
25: }
26:
27: protected SemanticRecorder createSemanticRecorder(Resolver r) {
28: return new DialogRecorder(r);
29: }
30:
31: public void testNoCaptureResizeIfNotResizable() {
32: final Dialog d = new Dialog(new Frame(getName()), getName());
33: d.add(new JLabel(getName()));
34: d.setResizable(false);
35: showWindow(d);
36: startRecording();
37: // NOTE: don't use tester resize/actionResize, since it checks the
38: // dialog for resizability.
39: invokeAndWait(new Runnable() {
40: public void run() {
41: d.setSize(d.getWidth() * 2, d.getHeight());
42: }
43: });
44: assertNoStep();
45: }
46:
47: public static void main(String[] args) {
48: RepeatHelper.runTests(args, DialogRecorderTest.class);
49: }
50: }
|