You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2020/06/16 06:57:37 UTC

[incubator-tuweni] branch master updated: Fix integration test

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

toulmean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git


The following commit(s) were added to refs/heads/master by this push:
     new 323fe9e  Fix integration test
323fe9e is described below

commit 323fe9ecfaa72c814bedf7ed494107c088bf365f
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Mon Jun 15 23:57:05 2020 -0700

    Fix integration test
---
 .../apache/tuweni/rlpx/vertx/VertxAcceptanceTest.java    | 16 ++++++++++++++--
 .../java/org/apache/tuweni/rlpx/wire/SubProtocol.java    |  5 ++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/rlpx/src/integrationTest/java/org/apache/tuweni/rlpx/vertx/VertxAcceptanceTest.java b/rlpx/src/integrationTest/java/org/apache/tuweni/rlpx/vertx/VertxAcceptanceTest.java
index 921588f..fc47898 100644
--- a/rlpx/src/integrationTest/java/org/apache/tuweni/rlpx/vertx/VertxAcceptanceTest.java
+++ b/rlpx/src/integrationTest/java/org/apache/tuweni/rlpx/vertx/VertxAcceptanceTest.java
@@ -18,6 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import org.apache.tuweni.bytes.Bytes;
 import org.apache.tuweni.bytes.Bytes32;
 import org.apache.tuweni.concurrent.AsyncCompletion;
+import org.apache.tuweni.concurrent.AsyncResult;
 import org.apache.tuweni.concurrent.CompletableAsyncCompletion;
 import org.apache.tuweni.crypto.SECP256K1;
 import org.apache.tuweni.junit.BouncyCastleExtension;
@@ -27,6 +28,7 @@ import org.apache.tuweni.rlpx.MemoryWireConnectionsRepository;
 import org.apache.tuweni.rlpx.RLPxService;
 import org.apache.tuweni.rlpx.wire.DefaultWireConnection;
 import org.apache.tuweni.rlpx.wire.SubProtocol;
+import org.apache.tuweni.rlpx.wire.SubProtocolClient;
 import org.apache.tuweni.rlpx.wire.SubProtocolHandler;
 import org.apache.tuweni.rlpx.wire.SubProtocolIdentifier;
 
@@ -106,6 +108,11 @@ class VertxAcceptanceTest {
       handler = new MyCustomSubProtocolHandler(service, id());
       return handler;
     }
+
+    @Override
+    public SubProtocolClient createClient(RLPxService service) {
+      return null;
+    }
   }
 
   @Test
@@ -253,16 +260,21 @@ class VertxAcceptanceTest {
           public SubProtocolHandler createHandler(RLPxService service) {
             return null;
           }
+
+          @Override
+          public SubProtocolClient createClient(RLPxService service) {
+            return null;
+          }
         }), "Client 1", repository);
     service.start().join();
 
-    AsyncCompletion completion = service
+    AsyncResult<String> completion = service
         .connectTo(
             SECP256K1.PublicKey
                 .fromHexString(
                     "7a8fbb31bff7c48179f8504b047313ebb7446a0233175ffda6eb4c27aaa5d2aedcef4dd9501b4f17b4f16588f0fd037f9b9416b8caca655bee3b14b4ef67441a"),
             new InetSocketAddress("localhost", 30303));
-    completion.join();
+    completion.get();
     Thread.sleep(10000);
 
     service.stop().join();
diff --git a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/SubProtocol.java b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/SubProtocol.java
index 84741e2..7783924 100644
--- a/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/SubProtocol.java
+++ b/rlpx/src/main/java/org/apache/tuweni/rlpx/wire/SubProtocol.java
@@ -15,6 +15,7 @@ package org.apache.tuweni.rlpx.wire;
 
 import org.apache.tuweni.rlpx.RLPxService;
 
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -62,5 +63,7 @@ public interface SubProtocol {
    * 
    * @return the capabilities for this protocol, ordered.
    */
-  List<SubProtocolIdentifier> getCapabilities();
+  default List<SubProtocolIdentifier> getCapabilities() {
+    return Collections.singletonList(id());
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org