Selaa lähdekoodia

Random test tidying.

pull/465/head
Chris Smith 8 vuotta sitten
vanhempi
commit
b5f291a63d

+ 8
- 8
calc/test/com/dmdirc/addons/calc/ParserTest.java Näytä tiedosto

@@ -142,11 +142,11 @@ public class ParserTest {
142 142
 
143 143
         parser.parseHiddenOperator(tokens, 0);
144 144
         assertEquals(4, tokens.size());
145
-        assertTrue(tokens.get(0).getToken().getType() == TokenType.BRACKET_OPEN);
145
+        assertSame(TokenType.BRACKET_OPEN, tokens.get(0).getToken().getType());
146 146
 
147 147
         parser.parseHiddenOperator(tokens, 3);
148 148
         assertEquals(3, tokens.size());
149
-        assertTrue(tokens.get(2).getToken().getType() == TokenType.BRACKET_CLOSE);
149
+        assertSame(TokenType.BRACKET_CLOSE, tokens.get(2).getToken().getType());
150 150
     }
151 151
 
152 152
     @Test
@@ -161,9 +161,9 @@ public class ParserTest {
161 161
 
162 162
         parser.parseUnaryOperator(tokens, 1);
163 163
         assertEquals(3, tokens.size());
164
-        assertTrue(tokens.get(0).getToken().getType() == TokenType.START);
165
-        assertTrue(tokens.get(1).getToken().getType() == TokenType.MOD_NEGATIVE);
166
-        assertTrue(tokens.get(2).getToken().getType() == TokenType.END);
164
+        assertSame(TokenType.START, tokens.get(0).getToken().getType());
165
+        assertSame(TokenType.MOD_NEGATIVE, tokens.get(1).getToken().getType());
166
+        assertSame(TokenType.END, tokens.get(2).getToken().getType());
167 167
 
168 168
         assertTrue(tokens.get(1).isProcessed());
169 169
         assertEquals(1, tokens.get(1).getChildren().size());
@@ -184,9 +184,9 @@ public class ParserTest {
184 184
         parser.parseBinaryOperator(tokens, 2);
185 185
 
186 186
         assertEquals(3, tokens.size());
187
-        assertTrue(tokens.get(0).getToken().getType() == TokenType.START);
188
-        assertTrue(tokens.get(1).getToken().getType() == TokenType.OP_MINUS);
189
-        assertTrue(tokens.get(2).getToken().getType() == TokenType.END);
187
+        assertSame(TokenType.START, tokens.get(0).getToken().getType());
188
+        assertSame(TokenType.OP_MINUS, tokens.get(1).getToken().getType());
189
+        assertSame(TokenType.END, tokens.get(2).getToken().getType());
190 190
 
191 191
         assertTrue(tokens.get(1).isProcessed());
192 192
         assertEquals(2, tokens.get(1).getChildren().size());

+ 1
- 2
mediasource_vlc/test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java Näytä tiedosto

@@ -38,8 +38,7 @@ import static org.mockito.Mockito.*;
38 38
 public class VlcMediaSourcePluginTest {
39 39
 
40 40
     @Test
41
-    public void testProcessInformation1() throws IOException, URISyntaxException,
42
-            UnsupportedEncodingException {
41
+    public void testProcessInformation1() throws Exception {
43 42
         final PluginInfo pluginInfo = mock(PluginInfo.class);
44 43
         final IdentityController identityController = mock(IdentityController.class);
45 44
         final VlcManager plugin = new VlcManager(pluginInfo, identityController);

+ 10
- 10
ui_swing/test/com/dmdirc/addons/ui_swing/components/vetoable/VetoableListSelectionModelTest.java Näytä tiedosto

@@ -52,8 +52,8 @@ public class VetoableListSelectionModelTest {
52 52
     @Test
53 53
     public void testInitialState() {
54 54
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
55
-        assertEquals(instance.getLeadSelectionIndex(), -1);
56
-        assertEquals(instance.getSelectionMode(), SINGLE_SELECTION);
55
+        assertEquals(-1, instance.getLeadSelectionIndex());
56
+        assertEquals(SINGLE_SELECTION, instance.getSelectionMode());
57 57
         assertFalse(instance.getValueIsAdjusting());
58 58
     }
59 59
 
@@ -61,7 +61,7 @@ public class VetoableListSelectionModelTest {
61 61
     public void testNonVetoed() {
62 62
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
63 63
         instance.setLeadSelectionIndex(5);
64
-        assertEquals(instance.getLeadSelectionIndex(), 5);
64
+        assertEquals(5, instance.getLeadSelectionIndex());
65 65
     }
66 66
 
67 67
     @Test
@@ -69,7 +69,7 @@ public class VetoableListSelectionModelTest {
69 69
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
70 70
         instance.addVetoableSelectionListener(vetoListener);
71 71
         instance.setLeadSelectionIndex(5);
72
-        assertEquals(instance.getLeadSelectionIndex(), 5);
72
+        assertEquals(5, instance.getLeadSelectionIndex());
73 73
         verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
74 74
     }
75 75
 
@@ -80,7 +80,7 @@ public class VetoableListSelectionModelTest {
80 80
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
81 81
         instance.addVetoableSelectionListener(vetoListener);
82 82
         instance.setLeadSelectionIndex(5);
83
-        assertEquals(instance.getLeadSelectionIndex(), -1);
83
+        assertEquals(-1, instance.getLeadSelectionIndex());
84 84
     }
85 85
 
86 86
     @Test
@@ -88,7 +88,7 @@ public class VetoableListSelectionModelTest {
88 88
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
89 89
         instance.addListSelectionListener(selectionListener);
90 90
         instance.setLeadSelectionIndex(5);
91
-        assertEquals(instance.getLeadSelectionIndex(), 5);
91
+        assertEquals(5, instance.getLeadSelectionIndex());
92 92
         verify(selectionListener).valueChanged(any(ListSelectionEvent.class));
93 93
     }
94 94
 
@@ -98,7 +98,7 @@ public class VetoableListSelectionModelTest {
98 98
         instance.addListSelectionListener(selectionListener);
99 99
         instance.addVetoableSelectionListener(vetoListener);
100 100
         instance.setLeadSelectionIndex(5);
101
-        assertEquals(instance.getLeadSelectionIndex(), 5);
101
+        assertEquals(5, instance.getLeadSelectionIndex());
102 102
         verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
103 103
         verify(selectionListener).valueChanged(any(ListSelectionEvent.class));
104 104
     }
@@ -111,7 +111,7 @@ public class VetoableListSelectionModelTest {
111 111
         instance.addListSelectionListener(selectionListener);
112 112
         instance.addVetoableSelectionListener(vetoListener);
113 113
         instance.setLeadSelectionIndex(5);
114
-        assertEquals(instance.getLeadSelectionIndex(), -1);
114
+        assertEquals(-1, instance.getLeadSelectionIndex());
115 115
         verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class));
116 116
         verify(selectionListener, never()).valueChanged(any(ListSelectionEvent.class));
117 117
     }
@@ -120,9 +120,9 @@ public class VetoableListSelectionModelTest {
120 120
     public void testClearSelection() {
121 121
         final VetoableListSelectionModel instance = new VetoableListSelectionModel();
122 122
         instance.setLeadSelectionIndex(5);
123
-        assertEquals(instance.getLeadSelectionIndex(), 5);
123
+        assertEquals(5, instance.getLeadSelectionIndex());
124 124
         instance.clearSelection();
125
-        assertEquals(instance.getLeadSelectionIndex(), -1);
125
+        assertEquals(-1, instance.getLeadSelectionIndex());
126 126
     }
127 127
 
128 128
     @Test

Loading…
Peruuta
Tallenna