瀏覽代碼

Fix some unit tests

Change-Id: I2f14be0cecbc842b23dc3c99b5df257b8e6b0d53
Reviewed-on: http://gerrit.dmdirc.com/390
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
Tested-by: Gregory Holmes <greboid@dmdirc.com>
tags/0.6.3b1
Chris Smith 14 年之前
父節點
當前提交
b6e02f0a30

+ 3
- 3
test/com/dmdirc/actions/ActionComponentChainTest.java 查看文件

24
 
24
 
25
 import com.dmdirc.config.IdentityManager;
25
 import com.dmdirc.config.IdentityManager;
26
 
26
 
27
-import org.junit.Before;
27
+import org.junit.BeforeClass;
28
 import org.junit.Test;
28
 import org.junit.Test;
29
 import static org.junit.Assert.*;
29
 import static org.junit.Assert.*;
30
 
30
 
31
 public class ActionComponentChainTest {
31
 public class ActionComponentChainTest {
32
 
32
 
33
-    @Before
34
-    public void setUp() throws Exception {
33
+    @BeforeClass
34
+    public static void setUp() throws Exception {
35
         IdentityManager.load();
35
         IdentityManager.load();
36
         ActionManager.init();
36
         ActionManager.init();
37
     }
37
     }

+ 1
- 2
test/com/dmdirc/config/ConfigSourceTest.java 查看文件

22
 package com.dmdirc.config;
22
 package com.dmdirc.config;
23
 
23
 
24
 import com.dmdirc.harness.TestConfigSource;
24
 import com.dmdirc.harness.TestConfigSource;
25
-import java.awt.Color;
26
 import org.junit.Test;
25
 import org.junit.Test;
27
 import static org.junit.Assert.*;
26
 import static org.junit.Assert.*;
28
 
27
 
38
     
37
     
39
     @Test
38
     @Test
40
     public void testGetInt() {
39
     public void testGetInt() {
41
-        assertEquals(42, s.getOptionInt("true", "42"));
40
+        assertEquals(42, s.getOptionInt("true", "42").intValue());
42
     }
41
     }
43
     
42
     
44
     @Test
43
     @Test

+ 1
- 1
test/com/dmdirc/ui/messages/StyliserStylesTest.java 查看文件

63
         final StringBuilder builder = new StringBuilder();
63
         final StringBuilder builder = new StringBuilder();
64
         Styliser.addStyledString(doc, new String[]{input});
64
         Styliser.addStyledString(doc, new String[]{input});
65
         final AttributedCharacterIterator aci = Utils.getAttributedString(
65
         final AttributedCharacterIterator aci = Utils.getAttributedString(
66
-                new String[]{input, }, IdentityManager.getGlobalConfig()).
66
+                new String[]{input, }, "dialog", 12).
67
                 getAttributedString().getIterator();
67
                 getAttributedString().getIterator();
68
          
68
          
69
         Map<AttributedCharacterIterator.Attribute, Object> map = null;
69
         Map<AttributedCharacterIterator.Attribute, Object> map = null;

Loading…
取消
儲存