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-11: introducing junit5
Date Fri, 09 Sep 2016 22:02:48 GMT
Repository: incubator-gossip
Updated Branches:
  refs/heads/master 4e13c899f -> bbd453192


GOSSIP-11: introducing junit5


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

Branch: refs/heads/master
Commit: 316e8e752d9ed71c5facbcfe7f2308450edb6835
Parents: 4e13c89
Author: chandresh-pancholi <chandreshpancholi007@gmail.com>
Authored: Fri Sep 9 21:16:07 2016 +0530
Committer: chandresh-pancholi <chandreshpancholi007@gmail.com>
Committed: Fri Sep 9 21:16:07 2016 +0530

----------------------------------------------------------------------
 pom.xml                                         | 10 +++---
 .../org/apache/gossip/ShutdownDeadtimeTest.java |  2 +-
 .../org/apache/gossip/StartupSettingsTest.java  |  2 +-
 .../org/apache/gossip/TenNodeThreeSeedTest.java |  2 +-
 .../manager/RandomGossipManagerBuilderTest.java | 34 +++++++++++++-------
 5 files changed, 31 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/316e8e75/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7639d32..94e0018 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,12 +78,14 @@
 			<artifactId>jackson-datatype-json-org</artifactId>
 			<version>${jackson-datatype-json-org.version}</version>
 		</dependency>
+
 		<dependency>
-			<groupId>junit</groupId>
-			<artifactId>junit</artifactId>
-			<version>${junit.version}</version>
-			<scope>test</scope>
+			<groupId>org.junit.jupiter</groupId>
+			<artifactId>junit-jupiter-api</artifactId>
+			<version>5.0.0-M2</version>
 		</dependency>
+
+
 		<dependency>
 			<groupId>io.teknek</groupId>
 			<artifactId>tunit</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/316e8e75/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java b/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
index 98acb05..251550b 100644
--- a/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
+++ b/src/test/java/org/apache/gossip/ShutdownDeadtimeTest.java
@@ -31,10 +31,10 @@ import java.util.concurrent.TimeUnit;
 
 
 import org.apache.log4j.Logger;
-import org.junit.Test;
 
 import org.apache.gossip.event.GossipListener;
 import org.apache.gossip.event.GossipState;
+import org.junit.jupiter.api.Test;
 
 public class ShutdownDeadtimeTest {
 

http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/316e8e75/src/test/java/org/apache/gossip/StartupSettingsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/gossip/StartupSettingsTest.java b/src/test/java/org/apache/gossip/StartupSettingsTest.java
index 4b064ec..ed069c3 100644
--- a/src/test/java/org/apache/gossip/StartupSettingsTest.java
+++ b/src/test/java/org/apache/gossip/StartupSettingsTest.java
@@ -19,9 +19,9 @@ package org.apache.gossip;
 
 import org.apache.log4j.Logger;
 import org.json.JSONException;
-import org.junit.Test;
 
 import io.teknek.tunit.TUnit;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.FileOutputStream;

http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/316e8e75/src/test/java/org/apache/gossip/TenNodeThreeSeedTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/gossip/TenNodeThreeSeedTest.java b/src/test/java/org/apache/gossip/TenNodeThreeSeedTest.java
index dd7d021..350fc6f 100644
--- a/src/test/java/org/apache/gossip/TenNodeThreeSeedTest.java
+++ b/src/test/java/org/apache/gossip/TenNodeThreeSeedTest.java
@@ -30,10 +30,10 @@ import java.util.concurrent.TimeUnit;
 
 
 import org.apache.log4j.Logger;
-import org.junit.Test;
 
 import org.apache.gossip.event.GossipListener;
 import org.apache.gossip.event.GossipState;
+import org.junit.jupiter.api.Test;
 
 public class TenNodeThreeSeedTest {
   private static final Logger log = Logger.getLogger( TenNodeThreeSeedTest.class );

http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/316e8e75/src/test/java/org/apache/gossip/manager/RandomGossipManagerBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/gossip/manager/RandomGossipManagerBuilderTest.java b/src/test/java/org/apache/gossip/manager/RandomGossipManagerBuilderTest.java
index 4d77460..6c63516 100644
--- a/src/test/java/org/apache/gossip/manager/RandomGossipManagerBuilderTest.java
+++ b/src/test/java/org/apache/gossip/manager/RandomGossipManagerBuilderTest.java
@@ -23,8 +23,7 @@ import org.apache.gossip.LocalGossipMember;
 import org.apache.gossip.event.GossipListener;
 import org.apache.gossip.event.GossipState;
 import org.apache.gossip.manager.random.RandomGossipManager;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import javax.management.Notification;
 import javax.management.NotificationListener;
@@ -34,6 +33,11 @@ import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.expectThrows;
+
+
 public class RandomGossipManagerBuilderTest {
 
   public static class TestGossipListener implements GossipListener {
@@ -50,21 +54,27 @@ public class RandomGossipManagerBuilderTest {
     }
   }
 
-  @Test(expected=IllegalArgumentException.class)
+  @Test
   public void idShouldNotBeNull() {
-    RandomGossipManager.newBuilder().cluster("aCluster").build();
+    expectThrows(IllegalArgumentException.class,() -> {
+        RandomGossipManager.newBuilder().cluster("aCluster").build();
+    });
   }
 
-  @Test(expected=IllegalArgumentException.class)
+  @Test
   public void clusterShouldNotBeNull() {
-    RandomGossipManager.newBuilder().withId("id").build();
+      expectThrows(IllegalArgumentException.class,() -> {
+          RandomGossipManager.newBuilder().withId("id").build();
+      });
   }
 
-  @Test(expected=IllegalArgumentException.class)
+  @Test
   public void settingsShouldNotBeNull() {
-    RandomGossipManager.newBuilder().withId("id").cluster("aCluster").build();
-  }
+      expectThrows(IllegalArgumentException.class,() -> {
+          RandomGossipManager.newBuilder().withId("id").cluster("aCluster").build();
+      });
 
+  }
   @Test
   public void createMembersListIfNull() throws URISyntaxException {
     RandomGossipManager gossipManager = RandomGossipManager.newBuilder()
@@ -74,7 +84,7 @@ public class RandomGossipManagerBuilderTest {
         .settings(new GossipSettings())
         .gossipMembers(null).build();
 
-    Assert.assertNotNull(gossipManager.getLiveMembers());
+    assertNotNull(gossipManager.getLiveMembers());
   }
 
   @Test
@@ -89,8 +99,8 @@ public class RandomGossipManagerBuilderTest {
         .settings(new GossipSettings())
         .uri(new URI("udp://localhost:8000"))
         .gossipMembers(memberList).build();
-    Assert.assertEquals(1, gossipManager.getLiveMembers().size());
-    Assert.assertEquals(member.getId(), gossipManager.getLiveMembers().get(0).getId());
+    assertEquals(1, gossipManager.getLiveMembers().size());
+    assertEquals(member.getId(), gossipManager.getLiveMembers().get(0).getId());
   }
 
 }
\ No newline at end of file


Mime
View raw message