|
19 | 19 | import static org.junit.Assert.assertTrue; |
20 | 20 |
|
21 | 21 | import org.easymock.EasyMock; |
| 22 | +import org.easymock.IAnswer; |
22 | 23 | import org.junit.After; |
23 | 24 | import org.junit.Before; |
24 | 25 | import org.junit.Test; |
25 | 26 |
|
26 | 27 | import com.alibaba.dubbo.common.URL; |
| 28 | +import com.alibaba.dubbo.common.logger.Logger; |
| 29 | +import com.alibaba.dubbo.common.logger.LoggerFactory; |
27 | 30 | import com.alibaba.dubbo.remoting.RemotingException; |
28 | 31 | import com.alibaba.dubbo.remoting.exchange.ExchangeClient; |
29 | 32 | import com.alibaba.dubbo.remoting.exchange.Exchangers; |
@@ -60,12 +63,18 @@ public void after() { |
60 | 63 | } |
61 | 64 |
|
62 | 65 | @Test |
63 | | - public void testListClient() throws RemotingException { |
| 66 | + public void testListClient() throws Exception { |
64 | 67 | ExchangeClient client1 = Exchangers.connect("dubbo://127.0.0.1:20887/demo"); |
65 | 68 | ExchangeClient client2 = Exchangers.connect("dubbo://127.0.0.1:20887/demo"); |
| 69 | + Thread.sleep(5000); |
66 | 70 | String result = port.telnet(null, "-l 20887"); |
67 | | - assertTrue(result.contains(client1.getLocalAddress().toString())); |
68 | | - assertTrue(result.contains(client2.getLocalAddress().toString())); |
| 71 | + String client1Addr = client1.getLocalAddress().toString(); |
| 72 | + String client2Addr = client2.getLocalAddress().toString(); |
| 73 | + System.out.printf("Result: %s %n", result); |
| 74 | + System.out.printf("Client 1 Address %s %n", client1Addr); |
| 75 | + System.out.printf("Client 2 Address %s %n", client2Addr); |
| 76 | + assertTrue(result.contains(client1Addr)); |
| 77 | + assertTrue(result.contains(client2Addr)); |
69 | 78 |
|
70 | 79 | } |
71 | 80 |
|
|
0 commit comments