Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A87F2200C36 for ; Fri, 10 Mar 2017 13:40:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A7110160B69; Fri, 10 Mar 2017 12:40:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C9231160B79 for ; Fri, 10 Mar 2017 13:40:12 +0100 (CET) Received: (qmail 96168 invoked by uid 500); 10 Mar 2017 12:40:12 -0000 Mailing-List: contact commits-help@gossip.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gossip.incubator.apache.org Delivered-To: mailing list commits@gossip.incubator.apache.org Received: (qmail 96159 invoked by uid 99); 10 Mar 2017 12:40:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2017 12:40:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 880121804C1 for ; Fri, 10 Mar 2017 12:40:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.569 X-Spam-Level: X-Spam-Status: No, score=-3.569 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id geQe1hxMACrX for ; Fri, 10 Mar 2017 12:40:10 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 30B855F252 for ; Fri, 10 Mar 2017 12:40:09 +0000 (UTC) Received: (qmail 96115 invoked by uid 99); 10 Mar 2017 12:40:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2017 12:40:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0FB8BDF982; Fri, 10 Mar 2017 12:40:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ecapriolo@apache.org To: commits@gossip.incubator.apache.org Date: Fri, 10 Mar 2017 12:40:08 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] incubator-gossip git commit: GOSSIP-72 rebase on trunk archived-at: Fri, 10 Mar 2017 12:40:13 -0000 GOSSIP-72 rebase on trunk Project: http://git-wip-us.apache.org/repos/asf/incubator-gossip/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-gossip/commit/19662d15 Tree: http://git-wip-us.apache.org/repos/asf/incubator-gossip/tree/19662d15 Diff: http://git-wip-us.apache.org/repos/asf/incubator-gossip/diff/19662d15 Branch: refs/heads/master Commit: 19662d15009e42a06c4f902703656ef091b4bdee Parents: bcd1051 dc0c727 Author: Edward Capriolo Authored: Fri Mar 10 07:39:36 2017 -0500 Committer: Edward Capriolo Committed: Fri Mar 10 07:39:36 2017 -0500 ---------------------------------------------------------------------- pom.xml | 5 +++++ src/test/java/org/apache/gossip/SignedMessageTest.java | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/19662d15/pom.xml ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/19662d15/src/test/java/org/apache/gossip/SignedMessageTest.java ---------------------------------------------------------------------- diff --cc src/test/java/org/apache/gossip/SignedMessageTest.java index 50e3cb5,0b0d469..5c3bb76 --- a/src/test/java/org/apache/gossip/SignedMessageTest.java +++ b/src/test/java/org/apache/gossip/SignedMessageTest.java @@@ -25,7 -25,9 +25,8 @@@ import java.net.UnknownHostException import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; + import java.util.Objects; import java.util.UUID; import java.util.concurrent.TimeUnit; @@@ -45,18 -47,14 +46,18 @@@ public class SignedMessageTest extends throws URISyntaxException, UnknownHostException, InterruptedException { String cluster = UUID.randomUUID().toString(); GossipSettings settings = gossiperThatSigns(); - List startupMembers = new ArrayList<>(); + List startupMembers = new ArrayList<>(); URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + 1)); - GossipService gossipService = new GossipService(cluster, uri, 1 + "", - new HashMap(), startupMembers, settings, (a, b) -> { }, - new MetricRegistry()); - gossipService.start(); + GossipManager gossipService = GossipManagerBuilder.newBuilder() + .cluster(cluster) + .uri(uri) + .id(1 + "") + .gossipMembers(startupMembers) + .gossipSettings(settings) + .build(); + gossipService.init(); } - + private GossipSettings gossiperThatSigns(){ GossipSettings settings = new GossipSettings(); settings.setPersistRingState(false); @@@ -65,29 -63,31 +66,35 @@@ return settings; } + private GossipSettings gossiperThatSigns(String keysDir){ + GossipSettings settings = gossiperThatSigns(); + settings.setPathToKeyStore(Objects.requireNonNull(keysDir)); + return settings; + } + @Test - public void dataTest() throws InterruptedException, URISyntaxException, NoSuchAlgorithmException, NoSuchProviderException, IOException{ + public void dataTest() throws InterruptedException, URISyntaxException, NoSuchAlgorithmException, NoSuchProviderException, IOException { - String keys = "./keys"; - GossipSettings settings = gossiperThatSigns(); + final String keys = System.getProperty("java.io.tmpdir") + "/keys"; + GossipSettings settings = gossiperThatSigns(keys); setup(keys); String cluster = UUID.randomUUID().toString(); - List startupMembers = new ArrayList<>(); + List startupMembers = new ArrayList<>(); for (int i = 1; i < 2; ++i) { URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + i)); - startupMembers.add(new RemoteGossipMember(cluster, uri, i + "")); + startupMembers.add(new RemoteMember(cluster, uri, i + "")); } - final List clients = new ArrayList<>(); + final List clients = new ArrayList<>(); for (int i = 1; i < 3; ++i) { URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + i)); - GossipService gossipService = new GossipService(cluster, uri, i + "", - new HashMap(), startupMembers, settings, - (a,b) -> {}, new MetricRegistry()); + GossipManager gossipService = GossipManagerBuilder.newBuilder() + .cluster(cluster) + .uri(uri) + .id(i + "") + .gossipMembers(startupMembers) + .gossipSettings(settings) + .build(); + gossipService.init(); clients.add(gossipService); - gossipService.start(); } assertTwoAlive(clients); assertOnlySignedMessages(clients);