소스 검색

Fix UI unit tests and associated hackery

Change-Id: Ibb88173ef74bb597cee62e1b1adcfe4cd0556d5b
Reviewed-on: http://gerrit.dmdirc.com/482
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
Tested-by: Gregory Holmes <greboid@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <devs-public@dmdirc.com>
tags/0.6.3
Chris Smith 14 년 전
부모
커밋
9c8ecf12e2

+ 0
- 3
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/WindowMenuScroller.java 파일 보기

@@ -53,9 +53,6 @@ public class WindowMenuScroller implements ConfigChangeListener {
53 53
      */
54 54
     public WindowMenuScroller(final JMenu menu, final String configDomain,
55 55
             final int fixedCount) {
56
-        if (IdentityManager.getGlobalConfig() == null) {
57
-            throw new IllegalArgumentException("null global config");
58
-        }
59 56
         this.menu = menu;
60 57
         this.configDomain = configDomain;
61 58
         this.fixedCount = fixedCount;

+ 2
- 4
test/com/dmdirc/addons/ui_swing/MainFrameTest.java 파일 보기

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing;
24 24
 
25
-import com.dmdirc.Main;
26 25
 import com.dmdirc.config.IdentityManager;
27 26
 import com.dmdirc.config.InvalidIdentityFileException;
28 27
 import com.dmdirc.addons.ui_swing.dialogs.FeedbackDialog;
@@ -52,12 +51,11 @@ public class MainFrameTest {
52 51
     public static void setUpClass() throws InvalidIdentityFileException {
53 52
         IdentityManager.load();
54 53
         IdentityManager.getAddonIdentity().setOption("test", "debugEDT", "false");
54
+        IdentityManager.getAddonIdentity().setOption("test", "windowMenuItems", "1");
55
+        IdentityManager.getAddonIdentity().setOption("test", "windowMenuScrollInterval", "1");
55 56
         controller = new SwingController();
56 57
         controller.setDomain("test");
57 58
         controller.onLoad();
58
-
59
-        Main.setUI(controller);
60
-        
61 59
     }
62 60
 
63 61
     @Before

+ 7
- 5
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java 파일 보기

@@ -47,7 +47,6 @@ import org.fest.swing.fixture.JInternalFrameFixture;
47 47
 import org.junit.After;
48 48
 import org.junit.Before;
49 49
 import org.junit.BeforeClass;
50
-import org.junit.Ignore;
51 50
 import org.junit.Test;
52 51
 
53 52
 public class InputTextFrameTest {
@@ -61,11 +60,14 @@ public class InputTextFrameTest {
61 60
     @BeforeClass
62 61
     public static void setUpClass() throws InvalidIdentityFileException {
63 62
         IdentityManager.load();
63
+        IdentityManager.getAddonIdentity().setOption("test", "windowMenuItems", "1");
64
+        IdentityManager.getAddonIdentity().setOption("test", "windowMenuScrollInterval", "1");
64 65
         IdentityManager.getAddonIdentity().setOption("test", "debugEDT", "false");
66
+        IdentityManager.getAddonIdentity().setOption("test", "textpanebackground", "");
65 67
         controller = new SwingController();
66 68
         controller.setDomain("test");
67 69
         controller.onLoad();
68
-        Main.setUI(controller);
70
+
69 71
         Main.ensureExists(PluginManager.getPluginManager(), "tabcompletion");
70 72
     }
71 73
 
@@ -99,7 +101,7 @@ public class InputTextFrameTest {
99 101
         dlg.target.dispose();
100 102
     }
101 103
 
102
-    @Test @Ignore
104
+    @Test
103 105
     public void testPasteDialogWithTextBefore() throws InterruptedException {
104 106
         window.textBox().enterText("testing:");
105 107
         ((InputTextFrame) window.target).doPaste("line1\nline2");
@@ -113,7 +115,7 @@ public class InputTextFrameTest {
113 115
         dlg.target.dispose();
114 116
     }
115 117
 
116
-    @Test @Ignore
118
+    @Test
117 119
     public void testPasteDialogWithTextAfter() throws InterruptedException {
118 120
         window.textBox().enterText("<- testing").pressAndReleaseKey(
119 121
                 KeyPressInfo.keyCode(KeyEvent.VK_HOME));
@@ -128,7 +130,7 @@ public class InputTextFrameTest {
128 130
         dlg.target.dispose();
129 131
     }
130 132
 
131
-    @Test @Ignore
133
+    @Test
132 134
     public void testPasteDialogWithTextAround() throws InterruptedException {
133 135
         window.textBox().enterText("testing:<- testing").selectText(8, 8);
134 136
         ((InputTextFrame) window.target).doPaste("line1\nline2");

Loading…
취소
저장