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/05/07 06:34:39 UTC

[incubator-tuweni] 02/02: add a java test for sanity

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

commit bd7c688d9e9675aefb53870f88870f8c7b065ddf
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Wed May 6 23:34:21 2020 -0700

    add a java test for sanity
---
 .../apache/tuweni/discovery/DiscoveryAPITest.java  | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/dns-discovery/src/integrationTest/java/org/apache/tuweni/discovery/DiscoveryAPITest.java b/dns-discovery/src/integrationTest/java/org/apache/tuweni/discovery/DiscoveryAPITest.java
new file mode 100644
index 0000000..80ea34d
--- /dev/null
+++ b/dns-discovery/src/integrationTest/java/org/apache/tuweni/discovery/DiscoveryAPITest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
+ * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
+ * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.tuweni.discovery;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.tuweni.devp2p.EthereumNodeRecord;
+import org.apache.tuweni.junit.BouncyCastleExtension;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+@ExtendWith(BouncyCastleExtension.class)
+class DiscoveryAPITest {
+
+  @Test
+  void resolveNames() {
+    DNSResolver resolver = new DNSResolver();
+    List<EthereumNodeRecord> nodes = new ArrayList<>();
+    DNSVisitor visitor = enr -> {
+      nodes.add(enr);
+      return false;
+    };
+    resolver
+        .visitTree("enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net", visitor);
+    assertTrue(nodes.size() > 0);
+  }
+}


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