| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 package org.appspot.apprtc; | 11 package org.appspot.apprtc; |
| 12 | 12 |
| 13 import org.appspot.apprtc.util.LooperExecutor; | |
| 14 import org.appspot.apprtc.util.RobolectricLooperExecutor; | 13 import org.appspot.apprtc.util.RobolectricLooperExecutor; |
| 15 import org.junit.After; | 14 import org.junit.After; |
| 16 import org.junit.Before; | 15 import org.junit.Before; |
| 17 import org.junit.Test; | 16 import org.junit.Test; |
| 18 import org.junit.runner.RunWith; | 17 import org.junit.runner.RunWith; |
| 19 import org.mockito.Mock; | 18 import org.mockito.Mock; |
| 20 import org.mockito.MockitoAnnotations; | 19 import org.mockito.MockitoAnnotations; |
| 21 import org.mockito.invocation.InvocationOnMock; | |
| 22 import org.mockito.stubbing.Answer; | |
| 23 import org.robolectric.RobolectricTestRunner; | 20 import org.robolectric.RobolectricTestRunner; |
| 24 import org.robolectric.annotation.Config; | 21 import org.robolectric.annotation.Config; |
| 25 import org.robolectric.shadows.ShadowLog; | 22 import org.robolectric.shadows.ShadowLog; |
| 26 | 23 |
| 27 import java.util.concurrent.ArrayBlockingQueue; | |
| 28 import java.util.concurrent.BlockingQueue; | |
| 29 | |
| 30 import static org.junit.Assert.fail; | 24 import static org.junit.Assert.fail; |
| 31 import static org.mockito.Matchers.any; | |
| 32 import static org.mockito.Mockito.doAnswer; | |
| 33 import static org.mockito.Mockito.timeout; | 25 import static org.mockito.Mockito.timeout; |
| 34 import static org.mockito.Mockito.verify; | 26 import static org.mockito.Mockito.verify; |
| 35 import static org.mockito.Mockito.verifyNoMoreInteractions; | 27 import static org.mockito.Mockito.verifyNoMoreInteractions; |
| 36 import static org.mockito.Mockito.when; | |
| 37 | 28 |
| 38 @RunWith(RobolectricTestRunner.class) | 29 @RunWith(RobolectricTestRunner.class) |
| 39 @Config(manifest = Config.NONE) | 30 @Config(manifest = Config.NONE) |
| 40 public class TCPChannelClientTest { | 31 public class TCPChannelClientTest { |
| 41 private static final int PORT = 8888; | 32 private static final int PORT = 8888; |
| 42 /** | 33 /** |
| 43 * How long we wait before trying to connect to the server. Chosen quite arbit
rarily and | 34 * How long we wait before trying to connect to the server. Chosen quite arbit
rarily and |
| 44 * could be made smaller if need be. | 35 * could be made smaller if need be. |
| 45 */ | 36 */ |
| 46 private static final int SERVER_WAIT = 10; | 37 private static final int SERVER_WAIT = 10; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 177 } |
| 187 | 178 |
| 188 /** | 179 /** |
| 189 * Verifies no more server or client events have been issued | 180 * Verifies no more server or client events have been issued |
| 190 */ | 181 */ |
| 191 private void verifyNoMoreEvents() { | 182 private void verifyNoMoreEvents() { |
| 192 verifyNoMoreInteractions(serverEvents); | 183 verifyNoMoreInteractions(serverEvents); |
| 193 verifyNoMoreInteractions(clientEvents); | 184 verifyNoMoreInteractions(clientEvents); |
| 194 } | 185 } |
| 195 } | 186 } |
| OLD | NEW |