01: package org.netbeans.jemmy.testing;
02:
03: import javax.swing.*;
04: import javax.swing.tree.*;
05: import java.awt.*;
06: import org.netbeans.jemmy.*;
07: import org.netbeans.jemmy.testing.*;
08: import org.netbeans.jemmy.operators.*;
09:
10: import java.lang.reflect.InvocationTargetException;
11:
12: public class jemmy_009 extends JemmyTest {
13:
14: public int runIt(Object obj) {
15:
16: try {
17: Exception e = (Exception) (new ActionProducer(
18: new org.netbeans.jemmy.Action() {
19: public Object launch(Object obj) {
20: try {
21: (new ClassReference(
22: "org.netbeans.jemmy.testing.Application_009"))
23: .startApplication();
24: } catch (Exception ex) {
25: return (ex);
26: }
27: return (null);
28: }
29:
30: public String getDescription() {
31: return ("");
32: }
33: }, false).produceAction(null));
34:
35: if (e != null) {
36: throw (e);
37: }
38:
39: EventDispatcher.waitQueueEmpty();
40:
41: JFrame frm0 = JFrameOperator.waitJFrame("Application_009",
42: false, true);
43:
44: if (((Application_009) frm0).getIndex() != 0) {
45: finalize();
46: return (1);
47: }
48:
49: JFrame frm1 = JFrameOperator.waitJFrame("Application_009",
50: false, true, 1);
51:
52: if (((Application_009) frm1).getIndex() != 1) {
53: finalize();
54: return (1);
55: }
56:
57: JFrame frm2 = JFrameOperator.waitJFrame("Application_009",
58: false, true, 2);
59:
60: if (((Application_009) frm2).getIndex() != 2) {
61: finalize();
62: return (1);
63: }
64:
65: final JFrameOperator frm2o = new JFrameOperator(frm2);
66: new Thread(new Runnable() {
67: public void run() {
68: try {
69: Thread.sleep(1000);
70: frm2o.setTitle("New Title");
71: } catch (InterruptedException e) {
72: }
73: }
74: }).start();
75: frm2o.waitTitle("New Title");
76:
77: finalize();
78: return (0);
79: } catch (Exception e) {
80: getOutput().printStackTrace(e);
81: finalize();
82: return (1);
83: }
84: }
85: }
|