]> git.argeo.org Git - gpl/argeo-slc.git/blob - AutoUiApplicationJemmy.java
d15b4fef764a26597e0aa78b4bd9703cf83990db
[gpl/argeo-slc.git] / AutoUiApplicationJemmy.java
1 package org.argeo.slc.jemmytest;
2
3 import org.argeo.slc.autoui.AutoUiActivator;
4 import org.argeo.slc.autoui.AutoUiApplication;
5 import org.netbeans.jemmy.ClassReference;
6 import org.netbeans.jemmy.operators.JButtonOperator;
7 import org.netbeans.jemmy.operators.JFrameOperator;
8 import org.netbeans.jemmy.operators.JLabelOperator;
9
10 public class AutoUiApplicationJemmy implements AutoUiApplication {
11 public void run() {
12 try {
13 execute(new Object());
14 } catch (Exception e) {
15 e.printStackTrace();
16 throw new RuntimeException("Could not execute as Runnable"
17 + e.getMessage());
18 }
19 }
20
21 public Object execute(Object object) throws Exception {
22
23 // Find components
24 JFrameOperator jFrameOperator = new JFrameOperator("HelloWorldSwing");
25 JButtonOperator jButtonOperator = new JButtonOperator(jFrameOperator,
26 "Button");
27 JLabelOperator jLabelOperator = new JLabelOperator(jFrameOperator,
28 "Hello World");
29
30 // Execute actions
31 jButtonOperator.push();
32
33 // Performs checks
34 String textAfterPush = jLabelOperator.getText();
35 AutoUiActivator.stdOut("textAfterPush=" + textAfterPush);
36
37 return null;
38 }
39
40 }