gossip-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecapri...@apache.org
Subject [2/2] incubator-gossip git commit: GOSSIP-72 rebase on trunk
Date Fri, 10 Mar 2017 12:40:08 GMT
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 <edlinuxguru@gmail.com>
Authored: Fri Mar 10 07:39:36 2017 -0500
Committer: Edward Capriolo <edlinuxguru@gmail.com>
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<GossipMember> startupMembers = new ArrayList<>();
 +    List<Member> startupMembers = new ArrayList<>();
      URI uri = new URI("udp://" + "127.0.0.1" + ":" + (30000 + 1));
 -    GossipService gossipService = new GossipService(cluster, uri, 1 + "",
 -            new HashMap<String, String>(), 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<GossipMember> startupMembers = new ArrayList<>();
 +    List<Member> 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<GossipService> clients = new ArrayList<>();
 +    final List<GossipManager> 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<String,String>(), 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);


Mime
View raw message