You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by rg...@apache.org on 2015/07/07 07:11:50 UTC
svn commit: r1689571 [2/2] - in /zookeeper/trunk: ./ src/contrib/rest/
src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/
src/contrib/zooinspector/ src/java/systest/org/apache/zookeeper/test/system/
src/java/test/org/apache/jute/ src/java/te...
Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatchEventWhenAutoResetTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatchEventWhenAutoResetTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatchEventWhenAutoResetTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatchEventWhenAutoResetTest.java Tue Jul 7 05:11:49 2015
@@ -29,15 +29,15 @@ import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.Watcher.Event.EventType;
import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
+import org.apache.zookeeper.ZKTestCase;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import junit.framework.TestCase;
-public class WatchEventWhenAutoResetTest extends TestCase {
+public class WatchEventWhenAutoResetTest extends ZKTestCase {
protected static final Logger LOG = LoggerFactory
.getLogger(WatchEventWhenAutoResetTest.class);
@@ -80,7 +80,7 @@ public class WatchEventWhenAutoResetTest
} catch (InterruptedException e) {
// ignoring the interrupt
} catch (TimeoutException e) {
- fail("can not connect to " + hostPort);
+ Assert.fail("can not connect to " + hostPort);
}
return zk;
}
Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/X509AuthTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/X509AuthTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/X509AuthTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/X509AuthTest.java Tue Jul 7 05:11:49 2015
@@ -39,12 +39,12 @@ import javax.net.ssl.X509KeyManager;
import javax.net.ssl.X509TrustManager;
import javax.security.auth.x500.X500Principal;
-import junit.framework.Assert;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.ZKTestCase;
import org.apache.zookeeper.server.MockServerCnxn;
import org.apache.zookeeper.server.auth.X509AuthenticationProvider;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Modified: zookeeper/trunk/src/recipes/election/test/org/apache/zookeeper/recipes/leader/LeaderElectionSupportTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/recipes/election/test/org/apache/zookeeper/recipes/leader/LeaderElectionSupportTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/recipes/election/test/org/apache/zookeeper/recipes/leader/LeaderElectionSupportTest.java (original)
+++ zookeeper/trunk/src/recipes/election/test/org/apache/zookeeper/recipes/leader/LeaderElectionSupportTest.java Tue Jul 7 05:11:49 2015
@@ -23,7 +23,6 @@ import java.util.concurrent.CountDownLat
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-import junit.framework.Assert;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
@@ -32,6 +31,7 @@ import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.recipes.leader.LeaderElectionSupport.EventType;
import org.apache.zookeeper.test.ClientBase;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
Modified: zookeeper/trunk/src/recipes/lock/test/org/apache/zookeeper/recipes/lock/ZNodeNameTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/recipes/lock/test/org/apache/zookeeper/recipes/lock/ZNodeNameTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/recipes/lock/test/org/apache/zookeeper/recipes/lock/ZNodeNameTest.java (original)
+++ zookeeper/trunk/src/recipes/lock/test/org/apache/zookeeper/recipes/lock/ZNodeNameTest.java Tue Jul 7 05:11:49 2015
@@ -17,17 +17,17 @@
*/
package org.apache.zookeeper.recipes.lock;
-import junit.framework.TestCase;
+
+import org.junit.Assert;
+import org.junit.Test;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.junit.Test;
-
/**
* test for znodenames
*/
-public class ZNodeNameTest extends TestCase {
+public class ZNodeNameTest {
@Test
public void testOrderWithSamePrefix() throws Exception {
String[] names = { "x-3", "x-5", "x-11", "x-1" };
@@ -43,7 +43,7 @@ public class ZNodeNameTest extends TestC
protected void assertOrderedNodeNames(String[] names, String[] expected) {
int size = names.length;
- assertEquals("The two arrays should be the same size!", names.length, expected.length);
+ Assert.assertEquals("The two arrays should be the same size!", names.length, expected.length);
SortedSet<ZNodeName> nodeNames = new TreeSet<ZNodeName>();
for (String name : names) {
nodeNames.add(new ZNodeName(name));
@@ -52,7 +52,7 @@ public class ZNodeNameTest extends TestC
int index = 0;
for (ZNodeName nodeName : nodeNames) {
String name = nodeName.getName();
- assertEquals("Node " + index, expected[index++], name);
+ Assert.assertEquals("Node " + index, expected[index++], name);
}
}