You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2018/02/05 04:35:34 UTC

[bookkeeper] branch master updated: Use BookieServer#getLocalAddress() in BookieClientTest

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d81d35  Use BookieServer#getLocalAddress() in BookieClientTest
3d81d35 is described below

commit 3d81d3527126398f1a80003d13ef2dedc00ad9fd
Author: Sijie Guo <si...@apache.org>
AuthorDate: Sun Feb 4 20:35:27 2018 -0800

    Use BookieServer#getLocalAddress() in BookieClientTest
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Charan Reddy Guttapalem <re...@gmail.com>
    
    This closes #1119 from sijie/fix_bookie_client_test
---
 .../src/test/java/org/apache/bookkeeper/test/BookieClientTest.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
index 2abf020..1e0750f 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookieClientTest.java
@@ -69,7 +69,6 @@ public class BookieClientTest {
     public EventLoopGroup eventLoopGroup;
     public OrderedSafeExecutor executor;
     private ScheduledExecutorService scheduler;
-    ServerConfiguration conf = TestBKConfiguration.newServerConfiguration();
 
     @Before
     public void setUp() throws Exception {
@@ -152,7 +151,7 @@ public class BookieClientTest {
         final Object notifyObject = new Object();
         byte[] passwd = new byte[20];
         Arrays.fill(passwd, (byte) 'a');
-        BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", port);
+        BookieSocketAddress addr = bs.getLocalAddress();
         ResultStruct arc = new ResultStruct();
 
         BookieClient bc = new BookieClient(new ClientConfiguration(), eventLoopGroup, executor,
@@ -255,7 +254,7 @@ public class BookieClientTest {
     @Test
     public void testNoLedger() throws Exception {
         ResultStruct arc = new ResultStruct();
-        BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", port);
+        BookieSocketAddress addr = bs.getLocalAddress();
         BookieClient bc = new BookieClient(new ClientConfiguration(), eventLoopGroup, executor,
                                            scheduler, NullStatsLogger.INSTANCE);
         synchronized (arc) {
@@ -267,7 +266,7 @@ public class BookieClientTest {
 
     @Test
     public void testGetBookieInfo() throws IOException, InterruptedException {
-        BookieSocketAddress addr = new BookieSocketAddress("127.0.0.1", port);
+        BookieSocketAddress addr = bs.getLocalAddress();
         BookieClient bc = new BookieClient(new ClientConfiguration(), new NioEventLoopGroup(), executor,
                                            scheduler, NullStatsLogger.INSTANCE);
         long flags = BookkeeperProtocol.GetBookieInfoRequest.Flags.FREE_DISK_SPACE_VALUE

-- 
To stop receiving notification emails like this one, please contact
sijie@apache.org.