From c52d762990c5b62d90facb587fc06acd4b65ad24 Mon Sep 17 00:00:00 2001 From: Grant Henke Date: Thu, 12 Nov 2015 22:40:27 -0600 Subject: [PATCH 1/2] CURATOR-281: Usage of TestingServer fails when upgrading to 3.0 Replace testng assertion with java assertion --- .../java/org/apache/curator/test/TestingZooKeeperMain.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java index 330beb154e..284ca24b2d 100644 --- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java +++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java @@ -32,7 +32,6 @@ import org.apache.zookeeper.server.quorum.QuorumPeerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.testng.Assert; import javax.management.JMException; import java.io.IOException; import java.lang.reflect.Field; @@ -132,7 +131,7 @@ public QuorumPeer getQuorumPeer() @Override public void blockUntilStarted() throws Exception { - Assert.assertTrue(timing.awaitLatch(latch)); + assert timing.awaitLatch(latch); if ( zkServer != null ) { From 03c5f1580af0e387827a3d3ac432c56e34d2a9a8 Mon Sep 17 00:00:00 2001 From: Grant Henke Date: Fri, 13 Nov 2015 10:05:23 -0600 Subject: [PATCH 2/2] Change to IllegalStateException --- .../java/org/apache/curator/test/TestingZooKeeperMain.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java index 284ca24b2d..b2389e9d3d 100644 --- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java +++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java @@ -131,7 +131,8 @@ public QuorumPeer getQuorumPeer() @Override public void blockUntilStarted() throws Exception { - assert timing.awaitLatch(latch); + if(!timing.awaitLatch(latch)) + throw new IllegalStateException("Timed out waiting for watch removal"); if ( zkServer != null ) {