diff --git a/calc/test/com/dmdirc/addons/calc/ParserTest.java b/calc/test/com/dmdirc/addons/calc/ParserTest.java index a18f20205..8cd146a34 100644 --- a/calc/test/com/dmdirc/addons/calc/ParserTest.java +++ b/calc/test/com/dmdirc/addons/calc/ParserTest.java @@ -142,11 +142,11 @@ public void testParseHidden() { parser.parseHiddenOperator(tokens, 0); assertEquals(4, tokens.size()); - assertTrue(tokens.get(0).getToken().getType() == TokenType.BRACKET_OPEN); + assertSame(TokenType.BRACKET_OPEN, tokens.get(0).getToken().getType()); parser.parseHiddenOperator(tokens, 3); assertEquals(3, tokens.size()); - assertTrue(tokens.get(2).getToken().getType() == TokenType.BRACKET_CLOSE); + assertSame(TokenType.BRACKET_CLOSE, tokens.get(2).getToken().getType()); } @Test @@ -161,9 +161,9 @@ public void testParseUnaryOps() { parser.parseUnaryOperator(tokens, 1); assertEquals(3, tokens.size()); - assertTrue(tokens.get(0).getToken().getType() == TokenType.START); - assertTrue(tokens.get(1).getToken().getType() == TokenType.MOD_NEGATIVE); - assertTrue(tokens.get(2).getToken().getType() == TokenType.END); + assertSame(TokenType.START, tokens.get(0).getToken().getType()); + assertSame(TokenType.MOD_NEGATIVE, tokens.get(1).getToken().getType()); + assertSame(TokenType.END, tokens.get(2).getToken().getType()); assertTrue(tokens.get(1).isProcessed()); assertEquals(1, tokens.get(1).getChildren().size()); @@ -184,9 +184,9 @@ public void testParseBinaryOps() { parser.parseBinaryOperator(tokens, 2); assertEquals(3, tokens.size()); - assertTrue(tokens.get(0).getToken().getType() == TokenType.START); - assertTrue(tokens.get(1).getToken().getType() == TokenType.OP_MINUS); - assertTrue(tokens.get(2).getToken().getType() == TokenType.END); + assertSame(TokenType.START, tokens.get(0).getToken().getType()); + assertSame(TokenType.OP_MINUS, tokens.get(1).getToken().getType()); + assertSame(TokenType.END, tokens.get(2).getToken().getType()); assertTrue(tokens.get(1).isProcessed()); assertEquals(2, tokens.get(1).getChildren().size()); diff --git a/mediasource_vlc/test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java b/mediasource_vlc/test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java index 0878ee738..fdb4ba9a8 100644 --- a/mediasource_vlc/test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java +++ b/mediasource_vlc/test/com/dmdirc/addons/mediasource_vlc/VlcMediaSourcePluginTest.java @@ -38,8 +38,7 @@ public class VlcMediaSourcePluginTest { @Test - public void testProcessInformation1() throws IOException, URISyntaxException, - UnsupportedEncodingException { + public void testProcessInformation1() throws Exception { final PluginInfo pluginInfo = mock(PluginInfo.class); final IdentityController identityController = mock(IdentityController.class); final VlcManager plugin = new VlcManager(pluginInfo, identityController); diff --git a/ui_swing/test/com/dmdirc/addons/ui_swing/components/vetoable/VetoableListSelectionModelTest.java b/ui_swing/test/com/dmdirc/addons/ui_swing/components/vetoable/VetoableListSelectionModelTest.java index 5a5f2fd9f..1755f4906 100644 --- a/ui_swing/test/com/dmdirc/addons/ui_swing/components/vetoable/VetoableListSelectionModelTest.java +++ b/ui_swing/test/com/dmdirc/addons/ui_swing/components/vetoable/VetoableListSelectionModelTest.java @@ -52,8 +52,8 @@ public class VetoableListSelectionModelTest { @Test public void testInitialState() { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); - assertEquals(instance.getLeadSelectionIndex(), -1); - assertEquals(instance.getSelectionMode(), SINGLE_SELECTION); + assertEquals(-1, instance.getLeadSelectionIndex()); + assertEquals(SINGLE_SELECTION, instance.getSelectionMode()); assertFalse(instance.getValueIsAdjusting()); } @@ -61,7 +61,7 @@ public void testInitialState() { public void testNonVetoed() { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), 5); + assertEquals(5, instance.getLeadSelectionIndex()); } @Test @@ -69,7 +69,7 @@ public void testVetoedCalled() throws PropertyVetoException { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); instance.addVetoableSelectionListener(vetoListener); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), 5); + assertEquals(5, instance.getLeadSelectionIndex()); verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class)); } @@ -80,7 +80,7 @@ public void testVetoedCalledAndVetoed() throws PropertyVetoException { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); instance.addVetoableSelectionListener(vetoListener); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), -1); + assertEquals(-1, instance.getLeadSelectionIndex()); } @Test @@ -88,7 +88,7 @@ public void testListenerCalledWithoutVetoListener() { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); instance.addListSelectionListener(selectionListener); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), 5); + assertEquals(5, instance.getLeadSelectionIndex()); verify(selectionListener).valueChanged(any(ListSelectionEvent.class)); } @@ -98,7 +98,7 @@ public void testListenerCalledWithVetoListenerNoVeto() throws PropertyVetoExcept instance.addListSelectionListener(selectionListener); instance.addVetoableSelectionListener(vetoListener); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), 5); + assertEquals(5, instance.getLeadSelectionIndex()); verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class)); verify(selectionListener).valueChanged(any(ListSelectionEvent.class)); } @@ -111,7 +111,7 @@ public void testListenerCalledWithVetoListenerWithVeto() throws PropertyVetoExce instance.addListSelectionListener(selectionListener); instance.addVetoableSelectionListener(vetoListener); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), -1); + assertEquals(-1, instance.getLeadSelectionIndex()); verify(vetoListener).vetoableChange(any(PropertyChangeEvent.class)); verify(selectionListener, never()).valueChanged(any(ListSelectionEvent.class)); } @@ -120,9 +120,9 @@ public void testListenerCalledWithVetoListenerWithVeto() throws PropertyVetoExce public void testClearSelection() { final VetoableListSelectionModel instance = new VetoableListSelectionModel(); instance.setLeadSelectionIndex(5); - assertEquals(instance.getLeadSelectionIndex(), 5); + assertEquals(5, instance.getLeadSelectionIndex()); instance.clearSelection(); - assertEquals(instance.getLeadSelectionIndex(), -1); + assertEquals(-1, instance.getLeadSelectionIndex()); } @Test