|
@@ -34,26 +34,27 @@ import com.dmdirc.addons.ui_swing.components.ImageButton;
|
34
|
34
|
import com.dmdirc.addons.ui_swing.components.text.TextLabel;
|
35
|
35
|
|
36
|
36
|
import java.awt.Component;
|
|
37
|
+import java.awt.Dialog;
|
37
|
38
|
import java.util.regex.Matcher;
|
38
|
39
|
import java.util.regex.Pattern;
|
39
|
40
|
|
40
|
|
-import javax.swing.JButton;
|
41
|
|
-import javax.swing.JPanel;
|
42
|
41
|
import javax.swing.JTextField;
|
43
|
|
-import javax.swing.text.JTextComponent;
|
44
|
42
|
|
45
|
43
|
import org.fest.swing.core.matcher.JButtonMatcher;
|
46
|
44
|
import org.fest.swing.core.matcher.JLabelMatcher;
|
|
45
|
+import org.fest.swing.edt.GuiActionRunner;
|
|
46
|
+import org.fest.swing.edt.GuiQuery;
|
47
|
47
|
import org.fest.swing.fixture.DialogFixture;
|
48
|
48
|
import org.fest.swing.fixture.JLabelFixture;
|
49
|
49
|
import org.fest.swing.fixture.JPanelFixture;
|
|
50
|
+import org.fest.swing.junit.testcase.FestSwingJUnitTestCase;
|
50
|
51
|
import org.junit.After;
|
51
|
52
|
import org.junit.Before;
|
52
|
53
|
import org.junit.BeforeClass;
|
53
|
54
|
import org.junit.Test;
|
54
|
55
|
import static org.junit.Assert.*;
|
55
|
56
|
|
56
|
|
-public class ActionEditorDialogTest {
|
|
57
|
+public class ActionEditorDialogTest extends FestSwingJUnitTestCase {
|
57
|
58
|
|
58
|
59
|
private DialogFixture window;
|
59
|
60
|
|
|
@@ -66,14 +67,16 @@ public class ActionEditorDialogTest {
|
66
|
67
|
}
|
67
|
68
|
|
68
|
69
|
@Before
|
69
|
|
- public void setUp() throws InvalidIdentityFileException {
|
|
70
|
+ @Override
|
|
71
|
+ public void onSetUp() {
|
70
|
72
|
if (!ActionManager.getGroups().containsKey("amd-ui-test1")) {
|
71
|
73
|
ActionManager.makeGroup("amd-ui-test1");
|
72
|
74
|
}
|
73
|
75
|
}
|
74
|
76
|
|
75
|
77
|
@After
|
76
|
|
- public void tearDown() {
|
|
78
|
+ @Override
|
|
79
|
+ public void onTearDown() {
|
77
|
80
|
if (window != null) {
|
78
|
81
|
window.cleanUp();
|
79
|
82
|
}
|
|
@@ -313,9 +316,16 @@ public class ActionEditorDialogTest {
|
313
|
316
|
}
|
314
|
317
|
|
315
|
318
|
protected void setupWindow(final Action action) {
|
316
|
|
- window = new DialogFixture(ActionEditorDialog.getActionEditorDialog(null,
|
317
|
|
- "amd-ui-test1", action));
|
318
|
|
- window.robot.settings().eventPostingDelay(250);
|
|
319
|
+ final Dialog d = GuiActionRunner.execute(new GuiQuery<Dialog>() {
|
|
320
|
+ @Override
|
|
321
|
+ protected Dialog executeInEDT() throws Throwable {
|
|
322
|
+ return ActionEditorDialog.getActionEditorDialog(null,
|
|
323
|
+ "amd-ui-test1", action);
|
|
324
|
+ }
|
|
325
|
+ });
|
|
326
|
+ robot().waitForIdle();
|
|
327
|
+
|
|
328
|
+ window = new DialogFixture(robot(), d);
|
319
|
329
|
window.show();
|
320
|
330
|
}
|
321
|
331
|
|