gossip-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecapri...@apache.org
Subject [1/2] incubator-gossip git commit: GOSSIP-72 Generate keys directory in target
Date Fri, 10 Mar 2017 12:40:07 GMT
Repository: incubator-gossip
Updated Branches:
  refs/heads/master bcd10510e -> 19662d150


GOSSIP-72 Generate keys directory in target


Project: http://git-wip-us.apache.org/repos/asf/incubator-gossip/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gossip/commit/dc0c727c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gossip/tree/dc0c727c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gossip/diff/dc0c727c

Branch: refs/heads/master
Commit: dc0c727c2c7931a91a11bed48fb25a159665863d
Parents: 22b9e75
Author: Josh Elser <elserj@apache.org>
Authored: Mon Mar 6 13:59:20 2017 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Mar 6 14:00:07 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/dc0c727c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a104451..3d8eb78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -208,6 +208,11 @@
             		<plugin>
                 		<artifactId>maven-surefire-plugin</artifactId>
                 		<version>2.19.1</version>
+                    <configuration>
+                      <systemPropertyVariables>
+                        <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
+                      </systemPropertyVariables>
+                    </configuration>
                 		<dependencies>
                     			<dependency>
                         			<groupId>org.junit.platform</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/dc0c727c/src/test/java/org/apache/gossip/SignedMessageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/gossip/SignedMessageTest.java b/src/test/java/org/apache/gossip/SignedMessageTest.java
index 6bea974..0b0d469 100644
--- a/src/test/java/org/apache/gossip/SignedMessageTest.java
+++ b/src/test/java/org/apache/gossip/SignedMessageTest.java
@@ -27,6 +27,7 @@ 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;
 
@@ -53,7 +54,7 @@ public class SignedMessageTest {
             new MetricRegistry());
     gossipService.start();
   }
-  
+
   private GossipSettings gossiperThatSigns(){
     GossipSettings settings = new GossipSettings();
     settings.setPersistRingState(false);
@@ -62,10 +63,16 @@ public class SignedMessageTest {
     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{
-    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<>();


Mime
View raw message