ソースを参照

Fix some build warnings.

pull/445/head
Chris Smith 8年前
コミット
8fc7cc28da

+ 9
- 7
channelwho/test/com/dmdirc/addons/channelwho/ConnectionHandlerTest.java ファイルの表示

@@ -55,6 +55,7 @@ import static org.junit.Assert.assertEquals;
55 55
 import static org.mockito.Matchers.any;
56 56
 import static org.mockito.Matchers.anyLong;
57 57
 import static org.mockito.Matchers.eq;
58
+import static org.mockito.Mockito.doReturn;
58 59
 import static org.mockito.Mockito.never;
59 60
 import static org.mockito.Mockito.verify;
60 61
 import static org.mockito.Mockito.when;
@@ -67,7 +68,7 @@ public class ConnectionHandlerTest {
67 68
     @Mock private WindowModel windowModel;
68 69
     @Mock private DMDircMBassador eventBus;
69 70
     @Mock private ScheduledExecutorService scheduledExecutorService;
70
-    @Mock private ScheduledFuture scheduledFuture;
71
+    @Mock private ScheduledFuture<?> scheduledFuture;
71 72
     @Mock private ConnectionManager connectionManager;
72 73
     @Mock private Connection connection;
73 74
     @Mock private GroupChat groupChat;
@@ -81,8 +82,9 @@ public class ConnectionHandlerTest {
81 82
 
82 83
     @Before
83 84
     public void setUp() throws Exception {
84
-        when(scheduledExecutorService.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(),
85
-                any())).thenReturn(scheduledFuture);
85
+        doReturn(scheduledFuture).when(
86
+                scheduledExecutorService.scheduleAtFixedRate(
87
+                        any(Runnable.class), anyLong(), anyLong(), any()));
86 88
         when(windowModel.getEventBus()).thenReturn(eventBus);
87 89
         when(connection.getWindowModel()).thenReturn(windowModel);
88 90
         when(config.getBinder()).thenReturn(configBinder);
@@ -108,7 +110,7 @@ public class ConnectionHandlerTest {
108 110
         instance.load();
109 111
         verify(configBinder).bind(instance, ConnectionHandler.class);
110 112
         verify(eventBus).subscribe(instance);
111
-        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(5l), eq(5l),
113
+        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(5L), eq(5L),
112 114
                 eq(TimeUnit.MILLISECONDS));
113 115
     }
114 116
 
@@ -124,9 +126,9 @@ public class ConnectionHandlerTest {
124 126
     public void testHandleWhoInterval() throws Exception {
125 127
         instance.handleWhoInterval(10);
126 128
         verify(scheduledFuture).cancel(false);
127
-        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(5l), eq(5l),
129
+        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(5L), eq(5L),
128 130
                 eq(TimeUnit.MILLISECONDS));
129
-        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(10l), eq(10l),
131
+        verify(scheduledExecutorService).scheduleAtFixedRate(any(Runnable.class), eq(10L), eq(10L),
130 132
                 eq(TimeUnit.MILLISECONDS));
131 133
     }
132 134
 
@@ -148,7 +150,7 @@ public class ConnectionHandlerTest {
148 150
 
149 151
     @Test
150 152
     public void testHandleAwayEvent_WithReason() throws Exception {
151
-        when(channelUserAwayEvent.getReason()).thenReturn(Optional.ofNullable("reason"));
153
+        when(channelUserAwayEvent.getReason()).thenReturn(Optional.of("reason"));
152 154
         instance.load();
153 155
         instance.handleAwayEvent(channelUserAwayEvent);
154 156
         verify(channelUserAwayEvent, never())

+ 3
- 0
redirect/src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java ファイルの表示

@@ -62,16 +62,19 @@ public class FakeWriteableFrameContainer extends FrameContainer {
62 62
     }
63 63
 
64 64
     @Override
65
+    @Deprecated
65 66
     public void addLine(final String type, final Date timestamp, final Object... args) {
66 67
         addLine(type, args);
67 68
     }
68 69
 
69 70
     @Override
71
+    @Deprecated
70 72
     public void addLine(final String type, final Object... args) {
71 73
         sendLine(Formatter.formatMessage(getConfigManager(), type, args));
72 74
     }
73 75
 
74 76
     @Override
77
+    @Deprecated
75 78
     public void addLine(final String line, final Date timestamp) {
76 79
         addLine(line);
77 80
     }

+ 2
- 2
ui_swing/test/com/dmdirc/addons/ui_swing/components/GenericTableModelTest.java ファイルの表示

@@ -39,9 +39,9 @@ import org.mockito.Captor;
39 39
 import org.mockito.Mock;
40 40
 import org.mockito.runners.MockitoJUnitRunner;
41 41
 
42
-import static junit.framework.Assert.assertEquals;
43
-import static junit.framework.Assert.assertSame;
42
+import static org.junit.Assert.assertEquals;
44 43
 import static org.junit.Assert.assertFalse;
44
+import static org.junit.Assert.assertSame;
45 45
 import static org.junit.Assert.assertTrue;
46 46
 import static org.mockito.Mockito.verify;
47 47
 

読み込み中…
キャンセル
保存