Bladeren bron

Minor random unit test changes

Change-Id: I8664f3e95f513642194cf5f96fb8b2d556cff7d1
Reviewed-on: http://gerrit.dmdirc.com/1070
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Chris Smith 14 jaren geleden
bovenliggende
commit
cca25e47e9

+ 1
- 0
.gitignore Bestand weergeven

@@ -25,6 +25,7 @@ __history
25 25
 *.a
26 26
 *.o
27 27
 *.ppu
28
+/reports/clover/
28 29
 /reports/findbugs/
29 30
 /reports/report-fb.html
30 31
 /reports/report-pmd.*

+ 23
- 1
test/com/dmdirc/actions/ActionComponentChainTest.java Bestand weergeven

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.actions;
24 24
 
25
+import com.dmdirc.Server;
25 26
 import com.dmdirc.config.IdentityManager;
26 27
 
27 28
 import org.junit.BeforeClass;
@@ -114,6 +115,27 @@ public class ActionComponentChainTest {
114 115
     public void testEmptyToString() {
115 116
         final ActionComponentChain chain = new ActionComponentChain(String.class, "");
116 117
         chain.toString();
117
-    }      
118
+    }
119
+
120
+    @Test()
121
+    public void testRequiresConnection1() {
122
+        final ActionComponentChain chain = new ActionComponentChain(Server.class,
123
+                "SERVER_NETWORK");
124
+        assertTrue(chain.requiresConnection());
125
+    }
126
+
127
+    @Test()
128
+    public void testRequiresConnection2() {
129
+        final ActionComponentChain chain = new ActionComponentChain(Server.class,
130
+                "SERVER_NETWORK.STRING_LENGTH");
131
+        assertTrue(chain.requiresConnection());
132
+    }
133
+
134
+    @Test()
135
+    public void testRequiresConnection3() {
136
+        final ActionComponentChain chain = new ActionComponentChain(Server.class,
137
+                "SERVER_NAME.STRING_LENGTH");
138
+        assertFalse(chain.requiresConnection());
139
+    }
118 140
 
119 141
 }

+ 11
- 0
test/com/dmdirc/config/ConfigTargetTest.java Bestand weergeven

@@ -75,6 +75,17 @@ public class ConfigTargetTest {
75 75
         assertTrue(target.toString().toLowerCase().matches("profile"));
76 76
     }
77 77
 
78
+    @Test
79
+    public void testSetProtocol() {
80
+        final ConfigTarget target = new ConfigTarget();
81
+        target.setProtocol("irc");
82
+
83
+        assertEquals(target.getType(), ConfigTarget.TYPE.PROTOCOL);
84
+        assertEquals(target.getTypeName(), "protocol");
85
+        assertEquals(target.getData(), "irc");
86
+        assertTrue(target.toString().toLowerCase().matches("protocol.*: irc"));
87
+    }
88
+
78 89
     @Test
79 90
     public void testSetIrcd() {
80 91
         final ConfigTarget target = new ConfigTarget();

+ 2
- 1
test/com/dmdirc/config/prefs/PreferencesManagerTest.java Bestand weergeven

@@ -39,8 +39,9 @@ public class PreferencesManagerTest {
39 39
     @BeforeClass
40 40
     public static void setUp() throws Exception {
41 41
         IdentityManager.load();
42
-        PluginManager.getPluginManager();
42
+        Main.extractCorePlugins("ui_");
43 43
         Main.setUI(new SwingController());
44
+        PluginManager.getPluginManager();
44 45
     }    
45 46
 
46 47
     @Test

Laden…
Annuleren
Opslaan