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 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 private static final String TEST_MESSAGE_SERVER = "Hello, Server!"; | 45 private static final String TEST_MESSAGE_SERVER = "Hello, Server!"; |
46 private static final String TEST_MESSAGE_CLIENT = "Hello, Client!"; | 46 private static final String TEST_MESSAGE_CLIENT = "Hello, Client!"; |
47 | 47 |
48 @Mock TCPChannelClient.TCPChannelEvents serverEvents; | 48 @Mock TCPChannelClient.TCPChannelEvents serverEvents; |
49 @Mock TCPChannelClient.TCPChannelEvents clientEvents; | 49 @Mock TCPChannelClient.TCPChannelEvents clientEvents; |
50 | 50 |
51 private ExecutorService executor; | 51 private ExecutorService executor; |
52 private TCPChannelClient server; | 52 private TCPChannelClient server; |
53 private TCPChannelClient client; | 53 private TCPChannelClient client; |
54 | 54 |
55 | |
56 @Before | 55 @Before |
57 public void setUp() { | 56 public void setUp() { |
58 ShadowLog.stream = System.out; | 57 ShadowLog.stream = System.out; |
59 | 58 |
60 MockitoAnnotations.initMocks(this); | 59 MockitoAnnotations.initMocks(this); |
61 | 60 |
62 executor = Executors.newSingleThreadExecutor(); | 61 executor = Executors.newSingleThreadExecutor(); |
63 } | 62 } |
64 | 63 |
65 @After | 64 @After |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 * Queues runnable to be run and waits for it to be executed by the executor t
hread | 190 * Queues runnable to be run and waits for it to be executed by the executor t
hread |
192 */ | 191 */ |
193 public void executeAndWait(Runnable runnable) { | 192 public void executeAndWait(Runnable runnable) { |
194 try { | 193 try { |
195 executor.submit(runnable).get(); | 194 executor.submit(runnable).get(); |
196 } catch (Exception e) { | 195 } catch (Exception e) { |
197 fail(e.getMessage()); | 196 fail(e.getMessage()); |
198 } | 197 } |
199 } | 198 } |
200 } | 199 } |
OLD | NEW |