소스 검색

Ignore or remove tests that fail in a headless env

These need to be rewritten so the dependencies are mocked out

Change-Id: Id8890637da5483efaa112db7613e61fba366e878
Reviewed-on: http://gerrit.dmdirc.com/2378
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.6.7rc1
Chris Smith 12 년 전
부모
커밋
345fe77ea7

+ 2
- 0
test/com/dmdirc/ServerManagerTest.java 파일 보기

@@ -28,6 +28,7 @@ import com.dmdirc.plugins.PluginManager;
28 28
 
29 29
 import org.junit.After;
30 30
 import org.junit.BeforeClass;
31
+import org.junit.Ignore;
31 32
 import org.junit.Test;
32 33
 
33 34
 import static org.junit.Assert.*;
@@ -194,6 +195,7 @@ public class ServerManagerTest {
194 195
     }
195 196
 
196 197
     @Test
198
+    @Ignore("Doesn't work in a headless environment (causes a new server to initialise an IRCDocument)")
197 199
     public void testDevChatNoServers() {
198 200
         final Server serverA = mock(Server.class);
199 201
         when(serverA.isNetwork("Quakenet")).thenReturn(true);

+ 0
- 44
test/com/dmdirc/ServerTest.java 파일 보기

@@ -42,7 +42,6 @@ public class ServerTest {
42 42
         server = new Server(new URI("irc-test://255.255.255.255"),
43 43
                 IdentityManager.getIdentityManager()
44 44
                 .getIdentitiesByType("profile").get(0));
45
-        server.connect();
46 45
     }
47 46
 
48 47
     @Test
@@ -70,7 +69,6 @@ public class ServerTest {
70 69
         server.addInvite(new Invite(server, "#chan1", "d!e@f"));
71 70
 
72 71
         assertEquals(1, server.getInvites().size());
73
-        //assertEquals("d", server.getInvites().get(0).getSource()[0]);
74 72
         server.removeInvites("#chan1");
75 73
     }
76 74
 
@@ -88,46 +86,4 @@ public class ServerTest {
88 86
         assertEquals(0, server.getInvites().size());
89 87
     }
90 88
 
91
-    @Test
92
-    public void testRemoveInvitesOnSocketClosed() {
93
-        server.reconnect();
94
-        server.addInvite(new Invite(server, "#chan1", "a!b@c"));
95
-        server.onSocketClosed();
96
-        assertEquals(0, server.getInvites().size());
97
-    }
98
-
99
-   /* @Test
100
-    public void testNumericActions() throws InterruptedException {
101
-        final TestActionListener tal = new TestActionListener();
102
-
103
-        server.disconnect();
104
-
105
-        ActionManager.init();
106
-        ActionManager.addListener(tal, CoreActionType.SERVER_NUMERIC);
107
-
108
-        server.reconnect();
109
-
110
-        Thread.sleep(1000); // Give the parser thread time to run + inject
111
-
112
-        assertEquals(1, tal.events.keySet().size());
113
-        assertTrue(tal.events.containsKey(CoreActionType.SERVER_NUMERIC));
114
-
115
-        final int[] counts = new int[6];
116
-
117
-        for (Object[] args : tal.events.values(CoreActionType.SERVER_NUMERIC)) {
118
-            counts[(Integer) args[1]]++;
119
-            assertSame("Server arg for numeric " + args[1] + " should be same. "
120
-                    + "Actual: " + args[0].hashCode() + " Expected: " + server.hashCode(),
121
-                    server, args[0]);
122
-        }
123
-
124
-        assertEquals(1, counts[1]);
125
-        assertEquals(1, counts[2]);
126
-        assertEquals(1, counts[3]);
127
-        assertEquals(1, counts[4]);
128
-        assertEquals(2, counts[5]);
129
-
130
-        server.disconnect();
131
-    }*/
132
-
133 89
 }

+ 2
- 0
test/com/dmdirc/ui/messages/StyliserStylesTest.java 파일 보기

@@ -38,6 +38,7 @@ import java.util.Map;
38 38
 import javax.swing.text.DefaultStyledDocument;
39 39
 
40 40
 import org.junit.BeforeClass;
41
+import org.junit.Ignore;
41 42
 import org.junit.Test;
42 43
 import org.junit.runner.RunWith;
43 44
 import org.junit.runners.Parameterized;
@@ -46,6 +47,7 @@ import static org.junit.Assert.*;
46 47
 import static org.mockito.Mockito.*;
47 48
 
48 49
 @RunWith(Parameterized.class)
50
+@Ignore("Doesn't work in a headless environment (initialises an IRCDocument)")
49 51
 public class StyliserStylesTest {
50 52
 
51 53
     protected String input, output;

+ 2
- 0
test/com/dmdirc/ui/messages/StyliserTest.java 파일 보기

@@ -30,6 +30,7 @@ import com.dmdirc.config.InvalidIdentityFileException;
30 30
 import java.util.Enumeration;
31 31
 
32 32
 import org.junit.Before;
33
+import org.junit.Ignore;
33 34
 import org.junit.Test;
34 35
 
35 36
 import static org.junit.Assert.*;
@@ -85,6 +86,7 @@ public class StyliserTest {
85 86
     }
86 87
 
87 88
     @Test
89
+    @Ignore("Doesn't work in a headless environment (initialises an IRCDocument)")
88 90
     public void testNegation() {
89 91
         final String input1 = ((char) 18) + "abc" + ((char) 2) + "def" + ((char) 31) + "ghi";
90 92
         final String input2 = "abcdefghi";

Loading…
취소
저장