Browse Source

fixes issue 2431; fixes issue 2430

tags/0.6.3m1rc1
Gregory Holmes 15 years ago
parent
commit
b8f2c93494

+ 5
- 2
test/com/dmdirc/addons/ui_swing/MainFrameTest.java View File

@@ -51,19 +51,22 @@ public class MainFrameTest implements UITestIface {
51 51
     
52 52
     private static FrameFixture window;
53 53
     private DialogFixture newwin;
54
+    private static SwingController controller;
54 55
 
55 56
     @BeforeClass
56 57
     public static void setUpClass() {
57 58
         IdentityManager.load();
59
+        controller = new SwingController();
60
+        controller.onLoad();
58 61
 
59
-        Main.setUI(new SwingController());
62
+        Main.setUI(controller);
60 63
         
61 64
     }
62 65
 
63 66
     @Before
64 67
     public void setUp() {
65 68
         if (window == null) {
66
-            window = new FrameFixture((MainFrame) Main.getUI().getMainWindow());
69
+            window = new FrameFixture(controller.getMainWindow());
67 70
             window.show();
68 71
         }
69 72
     }

+ 6
- 4
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java View File

@@ -64,11 +64,14 @@ public class InputTextFrameTest implements UITestIface {
64 64
     static JInternalFrameFixture window;
65 65
     static TestConfigManagerMap cmmap;
66 66
     static TestWritableFrameContainer owner;
67
+    static SwingController controller;
67 68
 
68 69
     @BeforeClass
69 70
     public static void setUpClass() {
70 71
         IdentityManager.load();
71
-        Main.setUI(new SwingController());
72
+        controller = new SwingController();
73
+        controller.onLoad();
74
+        Main.setUI(controller);
72 75
         Main.ensureExists(PluginManager.getPluginManager(), "tabcompletion");
73 76
     }
74 77
 
@@ -148,12 +151,11 @@ public class InputTextFrameTest implements UITestIface {
148 151
     protected void setupWindow(final ConfigManager configManager) {
149 152
         UIUtilities.initUISettings();
150 153
 
151
-        mainframe = new FrameFixture((MainFrame) Main.getUI().getMainWindow());
154
+        mainframe = new FrameFixture(controller.getMainWindow());
152 155
         mainframe.robot.settings().eventMode(EventMode.AWT);
153 156
 
154 157
         final CustomInputFrame titf = new CustomInputFrame(owner,
155
-                GlobalCommandParser.getGlobalCommandParser(), 
156
-                (SwingController) Main.getUI());
158
+                GlobalCommandParser.getGlobalCommandParser(), controller);
157 159
 
158 160
         titf.setTitle("testing123");
159 161
 

Loading…
Cancel
Save