zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r1689571 [1/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...
Date Tue, 07 Jul 2015 05:11:50 GMT
Author: rgs
Date: Tue Jul  7 05:11:49 2015
New Revision: 1689571

URL: http://svn.apache.org/r1689571
Log:
ZOOKEEPER-2223: support method-level JUnit testcase
(Akihiro Suda via rgs)

Added:
    zookeeper/trunk/src/java/test/org/apache/zookeeper/ZKParameterized.java
Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/build.xml
    zookeeper/trunk/ivy.xml
    zookeeper/trunk/src/contrib/rest/build.xml
    zookeeper/trunk/src/contrib/rest/ivy.xml
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/Base.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/CreateTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/DeleteTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/ExistsTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetChildrenTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/RootTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SessionTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SetTest.java
    zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/WadlTest.java
    zookeeper/trunk/src/contrib/zooinspector/ivy.xml
    zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
    zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/SimpleSysTest.java
    zookeeper/trunk/src/java/test/org/apache/jute/BinaryInputArchiveTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/ClientReconnectTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/CustomHostProviderTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/JUnit4ZKTestRunner.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiResponseTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiTransactionRecordTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/PortAssignmentTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/RemoveWatchesTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/VerGenTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/common/PathUtilsTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/common/TimeTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/DatadirCleanupManagerTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NettyServerCnxnTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/SessionTrackerTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesReportTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerConfTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperThreadTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZxidRolloverTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/admin/CommandResponseTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/FLETestUtils.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumRequestPipelineTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/JMXEnv.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/MultiTransactionTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/OSMXBeanTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/SessionInvalidationTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StringUtilTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/WatchEventWhenAutoResetTest.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/X509AuthTest.java
    zookeeper/trunk/src/recipes/election/test/org/apache/zookeeper/recipes/leader/LeaderElectionSupportTest.java
    zookeeper/trunk/src/recipes/lock/test/org/apache/zookeeper/recipes/lock/ZNodeNameTest.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Tue Jul  7 05:11:49 2015
@@ -146,6 +146,9 @@ BUGFIXES:
   ZOOKEEPER-2224: Four letter command hangs when network is slow
   (Arshad Mohammad via rakeshr)
 
+  ZOOKEEPER-2223: support method-level JUnit testcase
+  (Akihiro Suda via rgs)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)  
 

Modified: zookeeper/trunk/build.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/build.xml?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/build.xml (original)
+++ zookeeper/trunk/build.xml Tue Jul  7 05:11:49 2015
@@ -1327,6 +1327,7 @@ xmlns:maven="antlib:org.apache.maven.art
         <propertyref name="test.data.dir" />
         <propertyref name="log4j.configuration" />
         <propertyref name="zookeeper.DigestAuthenticationProvider.superDigest" />
+        <propertyref name="test.method" />
       </propertyset>
       <path id="junit.classpath">
         <path refid="test.java.classpath" />

Modified: zookeeper/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/ivy.xml?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/ivy.xml (original)
+++ zookeeper/trunk/ivy.xml Tue Jul  7 05:11:49 2015
@@ -57,7 +57,7 @@
 
     <dependency org="org.vafer" name="jdeb" rev="0.8" conf="package->master"/>
 
-    <dependency org="junit" name="junit" rev="4.9" conf="test->default"/>
+    <dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
 	<dependency org="org.mockito" name="mockito-all" rev="1.8.2"
                conf="test->default"/>
     <dependency org="checkstyle" name="checkstyle" rev="5.0"

Modified: zookeeper/trunk/src/contrib/rest/build.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/build.xml?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/build.xml (original)
+++ zookeeper/trunk/src/contrib/rest/build.xml Tue Jul  7 05:11:49 2015
@@ -83,6 +83,9 @@
 			target="${target.jdk}" 
 			debug="on" encoding="${build.encoding}">
 			<classpath refid="classpath" />
+			<classpath>
+			  <pathelement location="${zk.root}/build/test/classes"/>
+			</classpath>
 		</javac>
 	</target>
 	
@@ -129,6 +132,9 @@
           <classpath>
              <pathelement path="${build.test}" />
           </classpath>
+	  <classpath>
+	    <pathelement location="${zk.root}/build/test/classes"/>
+	  </classpath>
           <formatter type="${test.junit.output.format}" />
           <batchtest todir="${test.log.dir}" unless="testcase">
               <fileset dir="${test.src.dir}"

Modified: zookeeper/trunk/src/contrib/rest/ivy.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/ivy.xml?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/ivy.xml (original)
+++ zookeeper/trunk/src/contrib/rest/ivy.xml Tue Jul  7 05:11:49 2015
@@ -41,7 +41,7 @@
     <dependency org="com.sun.jersey" name="jersey-server" rev="1.1.5.1" />
     <dependency org="com.sun.jersey" name="jersey-json" rev="1.1.5.1" />
 
-    <dependency org="junit" name="junit" rev="4.8.1" conf="test->default"/>
+    <dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
     <dependency org="com.sun.jersey" name="jersey-client" rev="1.1.5.1" conf="test->default"/>
   </dependencies>
 

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/Base.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/Base.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/Base.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/Base.java Tue Jul  7 05:11:49 2015
@@ -20,17 +20,17 @@ package org.apache.zookeeper.server.jers
 
 import java.io.ByteArrayInputStream;
 
-import junit.framework.TestCase;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.JUnit4ZKTestRunner;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.server.jersey.SetTest.MyWatcher;
 import org.apache.zookeeper.server.jersey.cfg.RestCfg;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.runner.RunWith;
 
 import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
@@ -39,7 +39,8 @@ import com.sun.jersey.api.client.WebReso
  * Test stand-alone server.
  * 
  */
-public class Base extends TestCase {
+@RunWith(JUnit4ZKTestRunner.class)
+public class Base {
    protected static final Logger LOG = LoggerFactory.getLogger(Base.class);
 
    protected static final String CONTEXT_PATH = "/zk";
@@ -56,8 +57,6 @@ public class Base extends TestCase {
 
    @Before
    public void setUp() throws Exception {
-       super.setUp();
-
        RestCfg cfg = new RestCfg(new ByteArrayInputStream(String.format(
                "rest.port=%s\n" + 
                "rest.endpoint.1=%s;%s\n",
@@ -75,8 +74,6 @@ public class Base extends TestCase {
 
    @After
    public void tearDown() throws Exception {
-       super.tearDown();
-
        client.destroy();
        zk.close();
        rest.stop();

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/CreateTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/CreateTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/CreateTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/CreateTest.java Tue Jul  7 05:11:49 2015
@@ -30,6 +30,7 @@ import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.jersey.jaxb.ZPath;
 import org.junit.Test;
+import org.junit.Assert;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
@@ -115,8 +116,6 @@ public class CreateTest extends Base {
 
     @Test
     public void testCreate() throws Exception {
-        LOG.info("STARTING " + getName());
-
         WebResource wr = znodesr.path(path).queryParam("dataformat", encoding)
             .queryParam("name", name);
         if (data == null) {
@@ -134,7 +133,7 @@ public class CreateTest extends Base {
         } else {
             cr = builder.post(ClientResponse.class, data);
         }
-        assertEquals(expectedStatus, cr.getClientResponseStatus());
+        Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
 
         if (expectedPath == null) {
             return;
@@ -142,11 +141,11 @@ public class CreateTest extends Base {
 
         ZPath zpath = cr.getEntity(ZPath.class);
         if (sequence) {
-            assertTrue(zpath.path.startsWith(expectedPath.path));
-            assertTrue(zpath.uri.startsWith(znodesr.path(path).toString()));
+            Assert.assertTrue(zpath.path.startsWith(expectedPath.path));
+            Assert.assertTrue(zpath.uri.startsWith(znodesr.path(path).toString()));
         } else {
-            assertEquals(expectedPath, zpath);
-            assertEquals(znodesr.path(path).toString(), zpath.uri);
+            Assert.assertEquals(expectedPath, zpath);
+            Assert.assertEquals(znodesr.path(path).toString(), zpath.uri);
         }
 
         // use out-of-band method to verify
@@ -154,9 +153,9 @@ public class CreateTest extends Base {
         if (data == null && this.data == null) {
             return;
         } else if (data == null || this.data == null) {
-            assertEquals(data, this.data);
+            Assert.assertEquals(data, this.data);
         } else {
-            assertTrue(new String(data) + " == " + new String(this.data),
+            Assert.assertTrue(new String(data) + " == " + new String(this.data),
                     Arrays.equals(data, this.data));
         }
     }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/DeleteTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/DeleteTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/DeleteTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/DeleteTest.java Tue Jul  7 05:11:49 2015
@@ -30,6 +30,7 @@ import org.apache.zookeeper.WatchedEvent
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.data.Stat;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -78,16 +79,15 @@ public class DeleteTest extends Base {
 
         ClientResponse cr = znodesr.path(zpath).accept(type).type(type)
             .delete(ClientResponse.class);
-        assertEquals(expectedStatus, cr.getClientResponseStatus());
+        Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
 
         // use out-of-band method to verify
         Stat stat = zk.exists(zpath, false);
-        assertNull(stat);
+        Assert.assertNull(stat);
     }
 
     @Test
     public void testDelete() throws Exception {
-        LOG.info("STARTING " + getName());
         verify(MediaType.APPLICATION_OCTET_STREAM);
         verify(MediaType.APPLICATION_JSON);
         verify(MediaType.APPLICATION_XML);

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/ExistsTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/ExistsTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/ExistsTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/ExistsTest.java Tue Jul  7 05:11:49 2015
@@ -25,6 +25,7 @@ import javax.ws.rs.core.MediaType;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -63,16 +64,15 @@ public class ExistsTest extends Base {
         ClientResponse cr = znodesr.path(path).accept(type).type(type).head();
         if (type.equals(MediaType.APPLICATION_OCTET_STREAM)
                 && expectedStatus == ClientResponse.Status.OK) {
-            assertEquals(ClientResponse.Status.NO_CONTENT,
+            Assert.assertEquals(ClientResponse.Status.NO_CONTENT,
                     cr.getClientResponseStatus());
         } else {
-            assertEquals(expectedStatus, cr.getClientResponseStatus());
+            Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
         }
     }
 
     @Test
     public void testExists() throws Exception {
-        LOG.info("STARTING " + getName());
         verify(MediaType.APPLICATION_OCTET_STREAM);
         verify(MediaType.APPLICATION_JSON);
         verify(MediaType.APPLICATION_XML);

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetChildrenTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetChildrenTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetChildrenTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetChildrenTest.java Tue Jul  7 05:11:49 2015
@@ -31,6 +31,7 @@ import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.server.jersey.jaxb.ZChildren;
 import org.apache.zookeeper.server.jersey.jaxb.ZChildrenJSON;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -99,8 +100,6 @@ public class GetChildrenTest extends Bas
 
     @Test
     public void testGetChildren() throws Exception {
-        LOG.info("STARTING " + getName());
-
         if (expectedChildren != null) {
             for(String child : expectedChildren) {
                 zk.create(expectedPath + "/" + child, null,
@@ -110,7 +109,7 @@ public class GetChildrenTest extends Bas
 
         ClientResponse cr = znodesr.path(path).queryParam("view", "children")
             .accept(accept).get(ClientResponse.class);
-        assertEquals(expectedStatus, cr.getClientResponseStatus());
+        Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
 
         if (expectedChildren == null) {
             return;
@@ -120,20 +119,20 @@ public class GetChildrenTest extends Bas
             ZChildrenJSON zchildren = cr.getEntity(ZChildrenJSON.class);
             Collections.sort(expectedChildren);
             Collections.sort(zchildren.children);
-            assertEquals(expectedChildren, zchildren.children);
-            assertEquals(znodesr.path(path).toString(), zchildren.uri);
-            assertEquals(znodesr.path(path).toString() + "/{child}",
+            Assert.assertEquals(expectedChildren, zchildren.children);
+            Assert.assertEquals(znodesr.path(path).toString(), zchildren.uri);
+            Assert.assertEquals(znodesr.path(path).toString() + "/{child}",
                     zchildren.child_uri_template);
         } else if (accept.equals(MediaType.APPLICATION_XML)) {
             ZChildren zchildren = cr.getEntity(ZChildren.class);
             Collections.sort(expectedChildren);
             Collections.sort(zchildren.children);
-            assertEquals(expectedChildren, zchildren.children);
-            assertEquals(znodesr.path(path).toString(), zchildren.uri);
-            assertEquals(znodesr.path(path).toString() + "/{child}",
+            Assert.assertEquals(expectedChildren, zchildren.children);
+            Assert.assertEquals(znodesr.path(path).toString(), zchildren.uri);
+            Assert.assertEquals(znodesr.path(path).toString() + "/{child}",
                     zchildren.child_uri_template);
         } else {
-            fail("unknown accept type");
+            Assert.fail("unknown accept type");
         }
     }
 }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/GetTest.java Tue Jul  7 05:11:49 2015
@@ -26,6 +26,7 @@ import javax.ws.rs.core.MediaType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.zookeeper.server.jersey.jaxb.ZStat;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -97,8 +98,6 @@ public class GetTest extends Base {
 
     @Test
     public void testGet() throws Exception {
-        LOG.info("STARTING " + getName());
-
         if (expectedStat != null) {
             if (expectedStat.data64 != null || expectedStat.dataUtf8 == null) {
                 zk.setData(expectedStat.path, expectedStat.data64, -1);
@@ -110,14 +109,14 @@ public class GetTest extends Base {
 
         ClientResponse cr = znodesr.path(path).queryParam("dataformat", encoding)
             .accept(accept).get(ClientResponse.class);
-        assertEquals(expectedStatus, cr.getClientResponseStatus());
+        Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
 
         if (expectedStat == null) {
             return;
         }
 
         ZStat zstat = cr.getEntity(ZStat.class);
-        assertEquals(expectedStat, zstat);
-        assertEquals(znodesr.path(path).toString(), zstat.uri);
+        Assert.assertEquals(expectedStat, zstat);
+        Assert.assertEquals(znodesr.path(path).toString(), zstat.uri);
     }
 }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/RootTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/RootTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/RootTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/RootTest.java Tue Jul  7 05:11:49 2015
@@ -26,13 +26,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.jersey.jaxb.ZPath;
+import org.junit.Assert;
 import org.junit.Test;
 
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.client.WebResource.Builder;
 
-
 /**
  * Test stand-alone server.
  *
@@ -42,8 +42,6 @@ public class RootTest extends Base {
 
     @Test
     public void testCreate() throws Exception {
-        LOG.info("STARTING " + getName());
-        
         String path = "/";
         String name = "roottest-create";
         byte[] data = "foo".getBytes();
@@ -54,15 +52,15 @@ public class RootTest extends Base {
 
         ClientResponse cr;
         cr = builder.post(ClientResponse.class, data);
-        assertEquals(ClientResponse.Status.CREATED, cr.getClientResponseStatus());
+        Assert.assertEquals(ClientResponse.Status.CREATED, cr.getClientResponseStatus());
 
         ZPath zpath = cr.getEntity(ZPath.class);
-        assertEquals(new ZPath(path + name), zpath);
-        assertEquals(znodesr.path(path).toString(), zpath.uri);
+        Assert.assertEquals(new ZPath(path + name), zpath);
+        Assert.assertEquals(znodesr.path(path).toString(), zpath.uri);
 
         // use out-of-band method to verify
         byte[] rdata = zk.getData(zpath.path, false, new Stat());
-        assertTrue(new String(rdata) + " == " + new String(data),
+        Assert.assertTrue(new String(rdata) + " == " + new String(data),
                 Arrays.equals(rdata, data));
     }
 }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SessionTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SessionTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SessionTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SessionTest.java Tue Jul  7 05:11:49 2015
@@ -29,6 +29,7 @@ import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.jersey.jaxb.ZSession;
 import org.codehaus.jettison.json.JSONException;
+import org.junit.Assert;
 import org.junit.Test;
 
 import com.sun.jersey.api.client.Client;
@@ -49,7 +50,7 @@ public class SessionTest extends Base {
         Builder b = wr.accept(MediaType.APPLICATION_JSON);
 
         ClientResponse cr = b.post(ClientResponse.class, null);
-        assertEquals(ClientResponse.Status.CREATED, cr
+        Assert.assertEquals(ClientResponse.Status.CREATED, cr
                 .getClientResponseStatus());
 
         return cr.getEntity(ZSession.class);
@@ -58,10 +59,10 @@ public class SessionTest extends Base {
     @Test
     public void testCreateNewSession() throws JSONException {
         ZSession session = createSession();
-        assertEquals(session.id.length(), 36);
+        Assert.assertEquals(session.id.length(), 36);
 
         // use out-of-band method to verify
-        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
     }
 
     @Test
@@ -69,11 +70,11 @@ public class SessionTest extends Base {
         ZSession session = createSession("1");
 
         // use out-of-band method to verify
-        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
 
         // wait for the session to be closed
         Thread.sleep(1500);
-        assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
     }
 
     @Test
@@ -83,12 +84,12 @@ public class SessionTest extends Base {
         WebResource wr = sessionsr.path(session.id);
         Builder b = wr.accept(MediaType.APPLICATION_JSON);
 
-        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
         ClientResponse cr = b.delete(ClientResponse.class, null);
-        assertEquals(ClientResponse.Status.NO_CONTENT, 
+        Assert.assertEquals(ClientResponse.Status.NO_CONTENT,
                 cr.getClientResponseStatus());
 
-        assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
     }
     
     @Test
@@ -100,13 +101,13 @@ public class SessionTest extends Base {
         Builder b = wr.accept(MediaType.APPLICATION_JSON);
         
         ClientResponse cr = b.put(ClientResponse.class, null);
-        assertEquals(ClientResponse.Status.OK, cr.getClientResponseStatus());
+        Assert.assertEquals(ClientResponse.Status.OK, cr.getClientResponseStatus());
         
         Thread.sleep(1500);
-        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
         
         Thread.sleep(1000);
-        assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
+        Assert.assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
     }
     
     @Test
@@ -123,12 +124,12 @@ public class SessionTest extends Base {
         
         Builder b = wr.accept(MediaType.APPLICATION_JSON);
         ClientResponse cr = b.post(ClientResponse.class);
-        assertEquals(ClientResponse.Status.CREATED, cr.getClientResponseStatus());
+        Assert.assertEquals(ClientResponse.Status.CREATED, cr.getClientResponseStatus());
         
         Stat stat = new Stat();
         zk.getData("/ephemeral-test", false, stat);
         
         ZooKeeper sessionZK = ZooKeeperService.getClient(CONTEXT_PATH, session.id);
-        assertEquals(stat.getEphemeralOwner(), sessionZK.getSessionId());
+        Assert.assertEquals(stat.getEphemeralOwner(), sessionZK.getSessionId());
     }
 }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SetTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SetTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SetTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/SetTest.java Tue Jul  7 05:11:49 2015
@@ -31,6 +31,7 @@ import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.jersey.jaxb.ZStat;
+import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -106,8 +107,6 @@ public class SetTest extends Base {
 
     @Test
     public void testSet() throws Exception {
-        LOG.info("STARTING " + getName());
-
         if (expectedStat != null) {
             zk.create(expectedStat.path, "initial".getBytes(), Ids.OPEN_ACL_UNSAFE,
                     CreateMode.PERSISTENT);
@@ -131,24 +130,24 @@ public class SetTest extends Base {
             // TODO investigate
             cr = builder.put(ClientResponse.class, new String(data));
         }
-        assertEquals(expectedStatus, cr.getClientResponseStatus());
+        Assert.assertEquals(expectedStatus, cr.getClientResponseStatus());
 
         if (expectedStat == null) {
             return;
         }
 
         ZStat zstat = cr.getEntity(ZStat.class);
-        assertEquals(expectedStat, zstat);
+        Assert.assertEquals(expectedStat, zstat);
 
         // use out-of-band method to verify
         byte[] data = zk.getData(zstat.path, false, new Stat());
         if (data == null && this.data == null) {
             return;
         } else if (data == null || this.data == null) {
-            fail((data == null ? null : new String(data)) + " == "
+            Assert.fail((data == null ? null : new String(data)) + " == "
                     + (this.data == null ? null : new String(this.data)));
         } else {
-            assertTrue(new String(data) + " == " + new String(this.data),
+            Assert.assertTrue(new String(data) + " == " + new String(this.data),
                     Arrays.equals(data, this.data));
         }
     }

Modified: zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/WadlTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/WadlTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/WadlTest.java (original)
+++ zookeeper/trunk/src/contrib/rest/src/test/org/apache/zookeeper/server/jersey/WadlTest.java Tue Jul  7 05:11:49 2015
@@ -20,6 +20,7 @@ package org.apache.zookeeper.server.jers
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.junit.Assert;
 import org.junit.Test;
 
 import com.sun.jersey.api.client.WebResource;
@@ -38,7 +39,7 @@ public class WadlTest extends Base {
         WebResource r = client.resource(BASEURI);
         String serviceWadl = r.path("application.wadl").
                 accept(MediaTypes.WADL).get(String.class);
-        assertTrue("Something wrong. Returned wadl length not > 0.",
+        Assert.assertTrue("Something wrong. Returned wadl length not > 0.",
                 serviceWadl.length() > 0);
     }
 }

Modified: zookeeper/trunk/src/contrib/zooinspector/ivy.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/contrib/zooinspector/ivy.xml?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/contrib/zooinspector/ivy.xml (original)
+++ zookeeper/trunk/src/contrib/zooinspector/ivy.xml Tue Jul  7 05:11:49 2015
@@ -36,7 +36,7 @@
     <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" transitive="false"/>
             
     <dependency org="log4j" name="log4j" rev="1.2.15" transitive="false"/>
-    <dependency org="junit" name="junit" rev="4.7" conf="test->default"/>
+    <dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
         <dependency org="org.apache.rat" name="apache-rat-tasks" 
                 rev="0.6" conf="releaseaudit->default"/>
     <dependency org="commons-lang" name="commons-lang" 
@@ -45,4 +45,4 @@
                 rev="3.1" conf="releaseaudit->default"/>
   </dependencies>
 
-</ivy-module>
\ No newline at end of file
+</ivy-module>

Modified: zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java (original)
+++ zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/BaseSysTest.java Tue Jul  7 05:11:49 2015
@@ -25,18 +25,19 @@ import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.HashMap;
 
-import junit.framework.TestCase;
 
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.runner.JUnitCore;
 
 @Ignore("No tests in this class.")
-public class BaseSysTest extends TestCase {
+public class BaseSysTest {
     private static final File testData = new File(
             System.getProperty("test.data.dir", "build/test/data"));
     private static int fakeBasePort = 33222;
@@ -51,15 +52,15 @@ public class BaseSysTest extends TestCas
         }
     }
     InstanceManager im;
-    @Override
-    protected void setUp() throws Exception {
+    @Before
+    public void setUp() throws Exception {
         if (!fakeMachines) {
             zk = new ZooKeeper(zkHostPort, 15000, new Watcher() {public void process(WatchedEvent e){}});
             im = new InstanceManager(zk, prefix);
         }
     }
-    @Override
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         im.close();
     }
 

Modified: zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/SimpleSysTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/SimpleSysTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/SimpleSysTest.java (original)
+++ zookeeper/trunk/src/java/systest/org/apache/zookeeper/test/system/SimpleSysTest.java Tue Jul  7 05:11:49 2015
@@ -30,6 +30,7 @@ import org.apache.zookeeper.Watcher.Even
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper.States;
 import org.apache.zookeeper.data.Stat;
+import org.junit.Assert;
 import org.junit.Test;
 import org.apache.zookeeper.common.Time;
 
@@ -82,10 +83,10 @@ public class SimpleSysTest extends BaseS
             for(int j = 0; j < maxTries; j++) {
                 try {
                     byte b[] = zk.getData("/simpleCase/" + i, false, stat);
-                    assertEquals("orig", new String(b));
+                    Assert.assertEquals("orig", new String(b));
                 } catch(NoNodeException e) {
                     if (j+1 == maxTries) {
-                        fail("Max tries exceeded on client " + i);
+                        Assert.fail("Max tries exceeded on client " + i);
                     }
                     Thread.sleep(1000);
                 }
@@ -99,11 +100,11 @@ public class SimpleSysTest extends BaseS
             if (i+1 > getServerCount()/2) {
                 startServer(i);
             } else if (i+1 == getServerCount()/2) {
-                assertTrue("Connection didn't recover", waitForConnect(zk, 10000));
+                Assert.assertTrue("Connection didn't recover", waitForConnect(zk, 10000));
                 try {
                     zk.setData("/simpleCase", "new".getBytes(), -1);
                 } catch(ConnectionLossException e) {
-                    assertTrue("Connection didn't recover", waitForConnect(zk, 10000));
+                    Assert.assertTrue("Connection didn't recover", waitForConnect(zk, 10000));
                     zk.setData("/simpleCase", "new".getBytes(), -1);
                 }
                 for(int j = 0; j < i; j++) {
@@ -113,11 +114,11 @@ public class SimpleSysTest extends BaseS
             }
         }
         Thread.sleep(100); // wait for things to stabilize
-        assertTrue("Servers didn't bounce", waitForConnect(zk, 15000));
+        Assert.assertTrue("Servers didn't bounce", waitForConnect(zk, 15000));
         try {
             zk.getData("/simpleCase", false, stat);
         } catch(ConnectionLossException e) {
-            assertTrue("Servers didn't bounce", waitForConnect(zk, 15000));
+            Assert.assertTrue("Servers didn't bounce", waitForConnect(zk, 15000));
         }
         
         // check that the change has propagated to everyone
@@ -128,7 +129,7 @@ public class SimpleSysTest extends BaseS
                     break;
                 }
                 if (j+1 == maxTries) {
-                    fail("max tries exceeded for " + i);
+                    Assert.fail("max tries exceeded for " + i);
                 }
                 Thread.sleep(1000);
             }
@@ -143,7 +144,7 @@ public class SimpleSysTest extends BaseS
                 for(int j = 0; j < maxTries; j++) {
                     zk.getData("/simpleCase/" + i, false, stat);
                     if (j+1 == maxTries) {
-                        fail("max tries exceeded waiting for child " + i + " to die");
+                        Assert.fail("max tries exceeded waiting for child " + i + " to die");
                     }
                     Thread.sleep(200);
                 }

Modified: zookeeper/trunk/src/java/test/org/apache/jute/BinaryInputArchiveTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/jute/BinaryInputArchiveTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/jute/BinaryInputArchiveTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/jute/BinaryInputArchiveTest.java Tue Jul  7 05:11:49 2015
@@ -17,13 +17,14 @@
  */
 package org.apache.jute;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 
 
+// TODO: introduce JuteTestCase as in ZKTestCase
 public class BinaryInputArchiveTest {
 
     @Test

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/ClientReconnectTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/ClientReconnectTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/ClientReconnectTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/ClientReconnectTest.java Tue Jul  7 05:11:49 2015
@@ -28,13 +28,11 @@ import java.nio.channels.SocketChannel;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
 import org.apache.zookeeper.client.HostProvider;
+import org.junit.Assert;
 import org.junit.Test;
 
-public class ClientReconnectTest extends TestCase {
+public class ClientReconnectTest extends ZKTestCase {
     private SocketChannel sc;
     private CountDownLatch countDownLatch = new CountDownLatch(3);
     

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/CustomHostProviderTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/CustomHostProviderTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/CustomHostProviderTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/CustomHostProviderTest.java Tue Jul  7 05:11:49 2015
@@ -17,17 +17,16 @@
  */
 package org.apache.zookeeper;
 
-import junit.framework.Assert;
-import junit.framework.TestCase;
 import org.apache.zookeeper.client.HostProvider;
 import org.apache.zookeeper.test.ClientBase;
+import org.junit.Assert;
 import org.junit.Test;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.Collection;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public class CustomHostProviderTest extends TestCase implements Watcher {
+public class CustomHostProviderTest extends ZKTestCase implements Watcher {
     private AtomicInteger counter = new AtomicInteger(3);
 
     private class SpecialHostProvider implements HostProvider {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/JUnit4ZKTestRunner.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/JUnit4ZKTestRunner.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/JUnit4ZKTestRunner.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/JUnit4ZKTestRunner.java Tue Jul  7 05:11:49 2015
@@ -26,6 +26,8 @@ import org.junit.runners.BlockJUnit4Clas
 import org.junit.runners.model.FrameworkMethod;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.Statement;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * The sole responsibility of this class is to print to the log when a test
@@ -38,6 +40,28 @@ public class JUnit4ZKTestRunner extends
         super(klass);
     }
 
+    public static List<FrameworkMethod> computeTestMethodsForClass(final Class klass, final List<FrameworkMethod> defaultMethods) {
+        List<FrameworkMethod> list = defaultMethods;
+        String methodName = System.getProperty("test.method");
+        if (methodName == null) {
+            LOG.info("No test.method specified. using default methods.");
+        } else {
+            LOG.info("Picked up test.method={}", methodName);
+            try {
+                list = Arrays.asList(new FrameworkMethod(klass.getMethod(methodName)));
+            } catch (NoSuchMethodException nsme) {
+                LOG.warn("{} does not have test.method={}. failing to default methods.", klass.getName(), methodName);
+            }
+        }
+        return list;
+    }
+
+
+    @Override
+    protected List<FrameworkMethod> computeTestMethods() {
+        return computeTestMethodsForClass(getTestClass().getJavaClass(), super.computeTestMethods());
+    }
+
     public static class LoggedInvokeMethod extends InvokeMethod {
         private final FrameworkMethod method;
         private final String name;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiResponseTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiResponseTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiResponseTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiResponseTest.java Tue Jul  7 05:11:49 2015
@@ -17,18 +17,18 @@
 
 package org.apache.zookeeper;
 
-import junit.framework.TestCase;
 import org.apache.jute.BinaryInputArchive;
 import org.apache.jute.BinaryOutputArchive;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.ByteBufferInputStream;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
-public class MultiResponseTest extends TestCase {
+public class MultiResponseTest extends ZKTestCase {
     public void testRoundTrip() throws IOException {
         MultiResponse response = new MultiResponse();
 
@@ -42,8 +42,8 @@ public class MultiResponseTest extends T
 
         MultiResponse decodedResponse = codeDecode(response);
 
-        assertEquals(response, decodedResponse);
-        assertEquals(response.hashCode(), decodedResponse.hashCode());
+        Assert.assertEquals(response, decodedResponse);
+        Assert.assertEquals(response.hashCode(), decodedResponse.hashCode());
     }
 
     @Test
@@ -51,8 +51,8 @@ public class MultiResponseTest extends T
         MultiResponse result = new MultiResponse();
         MultiResponse decodedResult = codeDecode(result);
 
-        assertEquals(result, decodedResult);
-        assertEquals(result.hashCode(), decodedResult.hashCode());
+        Assert.assertEquals(result, decodedResult);
+        Assert.assertEquals(result.hashCode(), decodedResult.hashCode());
     }
 
     private MultiResponse codeDecode(MultiResponse request) throws IOException {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiTransactionRecordTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiTransactionRecordTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiTransactionRecordTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/MultiTransactionRecordTest.java Tue Jul  7 05:11:49 2015
@@ -18,17 +18,17 @@
 
 package org.apache.zookeeper;
 
-import junit.framework.TestCase;
 import org.apache.jute.BinaryInputArchive;
 import org.apache.jute.BinaryOutputArchive;
 import org.apache.zookeeper.server.ByteBufferInputStream;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
-public class MultiTransactionRecordTest extends TestCase {
+public class MultiTransactionRecordTest extends ZKTestCase {
     @Test
     public void testRoundTrip() throws IOException {
         MultiTransactionRecord request = new MultiTransactionRecord();
@@ -39,8 +39,8 @@ public class MultiTransactionRecordTest
 
         MultiTransactionRecord decodedRequest = codeDecode(request);
 
-        assertEquals(request, decodedRequest);
-        assertEquals(request.hashCode(), decodedRequest.hashCode());
+        Assert.assertEquals(request, decodedRequest);
+        Assert.assertEquals(request.hashCode(), decodedRequest.hashCode());
     }
 
     @Test
@@ -48,8 +48,8 @@ public class MultiTransactionRecordTest
         MultiTransactionRecord request = new MultiTransactionRecord();
         MultiTransactionRecord decodedRequest = codeDecode(request);
 
-        assertEquals(request, decodedRequest);
-        assertEquals(request.hashCode(), decodedRequest.hashCode());
+        Assert.assertEquals(request, decodedRequest);
+        Assert.assertEquals(request.hashCode(), decodedRequest.hashCode());
     }
 
     private MultiTransactionRecord codeDecode(MultiTransactionRecord request) throws IOException {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/PortAssignmentTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/PortAssignmentTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/PortAssignmentTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/PortAssignmentTest.java Tue Jul  7 05:11:49 2015
@@ -29,6 +29,7 @@ import org.junit.runners.Parameterized.P
 import org.junit.Test;
 
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class PortAssignmentTest {
 
     private final String strProcessCount;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/RemoveWatchesTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/RemoveWatchesTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/RemoveWatchesTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/RemoveWatchesTest.java Tue Jul  7 05:11:49 2015
@@ -50,6 +50,7 @@ import org.slf4j.LoggerFactory;
  * Verifies removing watches using ZooKeeper client apis
  */
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class RemoveWatchesTest extends ClientBase {
     private static final Logger LOG = LoggerFactory
             .getLogger(RemoveWatchesTest.class);

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/VerGenTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/VerGenTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/VerGenTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/VerGenTest.java Tue Jul  7 05:11:49 2015
@@ -36,6 +36,7 @@ import org.junit.runners.Parameterized.P
  *
  */
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class VerGenTest extends ZKTestCase {
     @Parameters
     public static Collection<Object[]> data() {

Added: zookeeper/trunk/src/java/test/org/apache/zookeeper/ZKParameterized.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/ZKParameterized.java?rev=1689571&view=auto
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/ZKParameterized.java (added)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/ZKParameterized.java Tue Jul  7 05:11:49 2015
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.zookeeper;
+
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.Statement;
+import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters;
+import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParametersFactory;
+import org.junit.runners.parameterized.TestWithParameters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+public class ZKParameterized {
+    private static final Logger LOG = LoggerFactory.getLogger(ZKParameterized.class);
+    public static class RunnerFactory extends BlockJUnit4ClassRunnerWithParametersFactory {
+        @Override
+        public org.junit.runner.Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
+            return new ZKParameterized.Runner(test);
+        }
+    }
+
+    public static class Runner extends BlockJUnit4ClassRunnerWithParameters {
+        public Runner(TestWithParameters test) throws InitializationError {
+            super(test);
+        }
+
+
+        @Override
+        protected List<FrameworkMethod> computeTestMethods() {
+            return JUnit4ZKTestRunner.computeTestMethodsForClass(getTestClass().getJavaClass(), super.computeTestMethods());
+        }
+
+
+        @Override
+        protected Statement methodInvoker(FrameworkMethod method, Object test) {
+            return new JUnit4ZKTestRunner.LoggedInvokeMethod(method, test);
+        }
+    }
+}

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/common/PathUtilsTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/common/PathUtilsTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/common/PathUtilsTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/common/PathUtilsTest.java Tue Jul  7 05:11:49 2015
@@ -18,9 +18,10 @@
 
 package org.apache.zookeeper.common;
 
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Test;
 
-public class PathUtilsTest {
+public class PathUtilsTest extends ZKTestCase {
 
     @Test
     public void testValidatePath_ValidPath() {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/common/TimeTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/common/TimeTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/common/TimeTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/common/TimeTest.java Tue Jul  7 05:11:49 2015
@@ -18,13 +18,13 @@
 
 package org.apache.zookeeper.common;
 
-import junit.framework.Assert;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.test.ClientBase;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.Calendar;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/DatadirCleanupManagerTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/DatadirCleanupManagerTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/DatadirCleanupManagerTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/DatadirCleanupManagerTest.java Tue Jul  7 05:11:49 2015
@@ -24,14 +24,15 @@ import static org.apache.zookeeper.serve
 
 import java.io.File;
 
-import junit.framework.Assert;
 
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.test.ClientBase;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-public class DatadirCleanupManagerTest {
+public class DatadirCleanupManagerTest extends ZKTestCase {
 
     private DatadirCleanupManager purgeMgr;
     private File snapDir;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NIOServerCnxnTest.java Tue Jul  7 05:11:49 2015
@@ -19,13 +19,13 @@ package org.apache.zookeeper.server;
 
 import java.io.IOException;
 
-import junit.framework.Assert;
 
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.test.ClientBase;
+import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NettyServerCnxnTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NettyServerCnxnTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NettyServerCnxnTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/NettyServerCnxnTest.java Tue Jul  7 05:11:49 2015
@@ -18,12 +18,12 @@
 
 package org.apache.zookeeper.server;
 
-import junit.framework.Assert;
 
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.test.ClientBase;
+import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/SessionTrackerTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/SessionTrackerTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/SessionTrackerTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/SessionTrackerTest.java Tue Jul  7 05:11:49 2015
@@ -23,13 +23,13 @@ import java.io.IOException;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import junit.framework.Assert;
 
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.ZooDefs.OpCode;
 import org.apache.zookeeper.server.SessionTrackerImpl.SessionImpl;
 import org.apache.zookeeper.test.ClientBase;
+import org.junit.Assert;
 import org.junit.Test;
 
 /**

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java Tue Jul  7 05:11:49 2015
@@ -20,11 +20,12 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
-public class WatchesPathReportTest {
+public class WatchesPathReportTest extends ZKTestCase {
     private Map<String, Set<Long>> m;
     private WatchesPathReport r;
     @Before public void setUp() {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesReportTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesReportTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesReportTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesReportTest.java Tue Jul  7 05:11:49 2015
@@ -20,11 +20,12 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
-public class WatchesReportTest {
+public class WatchesReportTest extends ZKTestCase {
     private Map<Long, Set<String>> m;
     private WatchesReport r;
     @Before public void setUp() {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java Tue Jul  7 05:11:49 2015
@@ -17,11 +17,12 @@
 package org.apache.zookeeper.server;
 
 import java.util.Map;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
-public class WatchesSummaryTest {
+public class WatchesSummaryTest extends ZKTestCase {
     private WatchesSummary s;
     @Before public void setUp() {
         s = new WatchesSummary(1, 2, 3);

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerConfTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerConfTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerConfTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperServerConfTest.java Tue Jul  7 05:11:49 2015
@@ -17,11 +17,12 @@
 package org.apache.zookeeper.server;
 
 import java.util.Map;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
-public class ZooKeeperServerConfTest {
+public class ZooKeeperServerConfTest extends ZKTestCase {
     private ZooKeeperServerConf c;
     @Before public void setUp() {
         c = new ZooKeeperServerConf(1, "a", "b", 2, 3, 4, 5, 6L);

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperThreadTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperThreadTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperThreadTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZooKeeperThreadTest.java Tue Jul  7 05:11:49 2015
@@ -20,11 +20,12 @@ package org.apache.zookeeper.server;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import junit.framework.Assert;
 
+import org.apache.zookeeper.ZKTestCase;
+import org.junit.Assert;
 import org.junit.Test;
 
-public class ZooKeeperThreadTest {
+public class ZooKeeperThreadTest extends ZKTestCase {
     private CountDownLatch runningLatch = new CountDownLatch(1);
 
     public class MyThread extends ZooKeeperThread {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZxidRolloverTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZxidRolloverTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZxidRolloverTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/ZxidRolloverTest.java Tue Jul  7 05:11:49 2015
@@ -18,13 +18,12 @@
 
 package org.apache.zookeeper.server;
 
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
 
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.KeeperException.ConnectionLossException;
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.test.ClientBase;
@@ -32,13 +31,15 @@ import org.apache.zookeeper.test.ClientB
 import org.apache.zookeeper.test.ClientTest;
 import org.apache.zookeeper.test.QuorumUtil;
 import org.apache.zookeeper.test.QuorumUtil.PeerStruct;
+import org.junit.After;
 import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
 
 /**
  * Verify ZOOKEEPER-1277 - ensure that we handle epoch rollover correctly.
  */
-public class ZxidRolloverTest extends TestCase {
+public class ZxidRolloverTest extends ZKTestCase {
     private static final Logger LOG = Logger.getLogger(ZxidRolloverTest.class);
 
     private QuorumUtil qu;
@@ -52,9 +53,8 @@ public class ZxidRolloverTest extends Te
         return zkClients[idx-1];
     }
 
-    @Override
-    protected void setUp() throws Exception {
-        LOG.info("STARTING " + getName());
+    @Before
+    public void setUp() throws Exception {
         System.setProperty("zookeeper.admin.enableServer", "false");
 
         // set the snap count to something low so that we force log rollover
@@ -101,7 +101,7 @@ public class ZxidRolloverTest extends Te
             return;
         }
         try {
-            assertNull(zk.exists("/foofoofoo-connected", false));
+            Assert.assertNull(zk.exists("/foofoofoo-connected", false));
         } catch (ConnectionLossException e) {
             // second chance...
             // in some cases, leader change in particular, the timing is
@@ -115,7 +115,7 @@ public class ZxidRolloverTest extends Te
             Assert.assertTrue("Waiting for server down", ClientBase.waitForServerUp(
                     "127.0.0.1:" + peer.clientPort, ClientBase.CONNECTION_TIMEOUT));
 
-            assertNull(zk.exists("/foofoofoo-connected", false));
+            Assert.assertNull(zk.exists("/foofoofoo-connected", false));
         }
     }
 
@@ -139,8 +139,8 @@ public class ZxidRolloverTest extends Te
             return;
         }
         try {
-            assertNull(zk.exists("/foofoofoo-disconnected", false));
-            fail("expected client to be disconnected");
+            Assert.assertNull(zk.exists("/foofoofoo-disconnected", false));
+            Assert.fail("expected client to be disconnected");
         } catch (KeeperException e) {
             // success
         }
@@ -195,7 +195,7 @@ public class ZxidRolloverTest extends Te
             checkClientDisconnected(idx);
             try {
                 checkClientsDisconnected();
-            } catch (AssertionFailedError e) {
+            } catch (AssertionError e) {
                 // the clients may or may not have already reconnected
                 // to the recovered cluster, force a check, but ignore
             }
@@ -209,8 +209,8 @@ public class ZxidRolloverTest extends Te
         zksLeader.setZxid((zksLeader.getZxid() & 0xffffffff00000000L) | 0xfffffffcL);
     }
 
-    @Override
-    protected void tearDown() throws Exception {
+    @After
+    public void tearDown() throws Exception {
         LOG.info("tearDown starting");
         for (int i = 0; i < zkClients.length; i++) {
             zkClients[i].close();
@@ -244,10 +244,10 @@ public class ZxidRolloverTest extends Te
     private void checkNodes(ZooKeeper zk, int start, int count) throws Exception {
         LOG.info("Validating nodes " + start + " thru " + (start + count));
         for (int i = start; i < start + count; i++) {
-            assertNotNull(zk.exists("/foo" + i, false));
+            Assert.assertNotNull(zk.exists("/foo" + i, false));
             LOG.error("Exists zxid:" + Long.toHexString(zk.exists("/foo" + i, false).getCzxid()));
         }
-        assertNull(zk.exists("/foo" + (start + count), false));
+        Assert.assertNull(zk.exists("/foo" + (start + count), false));
     }
 
     /**
@@ -305,8 +305,8 @@ public class ZxidRolloverTest extends Te
         countCreated += createNodes(zk, countCreated, 10);
 
         // sanity check
-        assertTrue(countCreated > 0);
-        assertTrue(countCreated < 60);
+        Assert.assertTrue(countCreated > 0);
+        Assert.assertTrue(countCreated < 60);
     }
 
     /**
@@ -347,8 +347,8 @@ public class ZxidRolloverTest extends Te
         countCreated += createNodes(zk, countCreated, 10);
 
         // sanity check
-        assertTrue(countCreated > 0);
-        assertTrue(countCreated < 60);
+        Assert.assertTrue(countCreated > 0);
+        Assert.assertTrue(countCreated < 60);
     }
 
     /**
@@ -392,8 +392,8 @@ public class ZxidRolloverTest extends Te
         countCreated += createNodes(zk, countCreated, 10);
 
         // sanity check
-        assertTrue(countCreated > 0);
-        assertTrue(countCreated < 50);
+        Assert.assertTrue(countCreated > 0);
+        Assert.assertTrue(countCreated < 50);
     }
 
     /**
@@ -439,7 +439,7 @@ public class ZxidRolloverTest extends Te
         countCreated += createNodes(zk, countCreated, 10);
 
         // sanity check
-        assertTrue(countCreated > 0);
-        assertTrue(countCreated < 70);
+        Assert.assertTrue(countCreated > 0);
+        Assert.assertTrue(countCreated < 70);
     }
 }

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/admin/CommandResponseTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/admin/CommandResponseTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/admin/CommandResponseTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/admin/CommandResponseTest.java Tue Jul  7 05:11:49 2015
@@ -19,11 +19,12 @@ package org.apache.zookeeper.server.admi
 
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 
-public class CommandResponseTest {
+public class CommandResponseTest extends ZKTestCase {
     private CommandResponse r;
 
     @Before public void setUp() throws Exception {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java Tue Jul  7 05:11:49 2015
@@ -23,6 +23,7 @@ import java.nio.ByteBuffer;
 import java.util.ArrayList;
 
 import org.apache.jute.BinaryOutputArchive;
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooDefs.OpCode;
 import org.apache.zookeeper.data.Id;
@@ -41,7 +42,7 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class CommitProcessorConcurrencyTest {
+public class CommitProcessorConcurrencyTest extends ZKTestCase {
     protected static final Logger LOG =
             LoggerFactory.getLogger(CommitProcessorConcurrencyTest.class);
 

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/CommitProcessorTest.java Tue Jul  7 05:11:49 2015
@@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.LinkedBlockingQueue;
 
 import org.apache.jute.BinaryOutputArchive;
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.data.Id;
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.ZooDefs.OpCode;
@@ -69,7 +70,7 @@ import org.slf4j.LoggerFactory;
  * 3. The pipeline needs to be drained before a write request can enter.
  * 4. No in-flight write requests while processing a read request.
  */
-public class CommitProcessorTest {
+public class CommitProcessorTest extends ZKTestCase {
     protected static final Logger LOG =
         LoggerFactory.getLogger(CommitProcessorTest.class);
 

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/FLETestUtils.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/FLETestUtils.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/FLETestUtils.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/FLETestUtils.java Tue Jul  7 05:11:49 2015
@@ -19,6 +19,7 @@ package org.apache.zookeeper.server.quor
 
 import java.nio.ByteBuffer;
 
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.server.quorum.FastLeaderElection;
 import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.Vote;
@@ -29,7 +30,7 @@ import org.junit.Assert;
 
 import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;
 
-public class FLETestUtils {
+public class FLETestUtils extends ZKTestCase {
     protected static final Logger LOG = LoggerFactory.getLogger(FLETestUtils.class);
 
     /*

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumRequestPipelineTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumRequestPipelineTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumRequestPipelineTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/QuorumRequestPipelineTest.java Tue Jul  7 05:11:49 2015
@@ -38,8 +38,10 @@ import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;
 import org.apache.zookeeper.test.QuorumBase;
+import org.apache.zookeeper.ZKParameterized;
 
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class QuorumRequestPipelineTest extends QuorumBase {
     protected ServerState serverState;
     protected final CountDownLatch callComplete = new CountDownLatch(1);

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/WatchLeakTest.java Tue Jul  7 05:11:49 2015
@@ -63,6 +63,7 @@ import org.apache.zookeeper.server.MockS
 import org.apache.zookeeper.server.ZKDatabase;
 import org.apache.zookeeper.server.ZooTrace;
 import org.apache.zookeeper.server.persistence.FileTxnSnapLog;
+import org.apache.zookeeper.ZKParameterized;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.invocation.InvocationOnMock;
@@ -74,6 +75,7 @@ import org.slf4j.LoggerFactory;
  * Demonstrate ZOOKEEPER-1382 : Watches leak on expired session
  */
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class WatchLeakTest {
 
     protected static final Logger LOG = LoggerFactory

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java Tue Jul  7 05:11:49 2015
@@ -63,6 +63,7 @@ import org.apache.zookeeper.txn.CreateTx
 import org.apache.zookeeper.txn.ErrorTxn;
 import org.apache.zookeeper.txn.SetDataTxn;
 import org.apache.zookeeper.txn.TxnHeader;
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -70,7 +71,7 @@ import org.apache.zookeeper.server.quoru
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class Zab1_0Test {
+public class Zab1_0Test extends ZKTestCase {
     private static final int SYNC_LIMIT = 2;
 
     private static final Logger LOG = LoggerFactory.getLogger(Zab1_0Test.class);

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/server/util/VerifyingFileFactoryTest.java Tue Jul  7 05:11:49 2015
@@ -22,12 +22,13 @@ import static org.junit.Assert.*;
 
 import java.io.File;
 
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class VerifyingFileFactoryTest {
+public class VerifyingFileFactoryTest extends ZKTestCase {
 
     private Logger log;
 

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java Tue Jul  7 05:11:49 2015
@@ -40,7 +40,6 @@ import java.util.concurrent.TimeoutExcep
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 
-import junit.framework.TestCase;
 
 import org.apache.zookeeper.common.Time;
 import org.apache.zookeeper.common.X509Exception.SSLContextException;
@@ -490,7 +489,7 @@ public abstract class ClientBase extends
         for (ObjectName bean : children) {
             LOG.info("unexpected:" + bean.toString());
         }
-        TestCase.assertEquals("Unexpected bean exists!", 0, children.size());
+        Assert.assertEquals("Unexpected bean exists!", 0, children.size());
     }
 
     /**

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/JMXEnv.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/JMXEnv.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/JMXEnv.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/JMXEnv.java Tue Jul  7 05:11:49 2015
@@ -33,10 +33,10 @@ import javax.management.remote.JMXConnec
 import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
 
-import junit.framework.TestCase;
 
 import org.apache.zookeeper.jmx.CommonNames;
 import org.apache.zookeeper.jmx.MBeanRegistry;
+import org.junit.Assert;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -121,7 +121,7 @@ public class JMXEnv {
                 beans.removeAll(found);
             }
         } while ((expectedNames.length != found.size()) && (nTry < 600));
-        TestCase.assertEquals("expected " + Arrays.toString(expectedNames),
+        Assert.assertEquals("expected " + Arrays.toString(expectedNames),
                 expectedNames.length, found.size());
         return beans;
     }
@@ -144,7 +144,7 @@ public class JMXEnv {
         for (ObjectName bean : beans) {
             LOG.info("unexpected:" + bean.toString());
         }
-        TestCase.assertEquals(0, beans.size());
+        Assert.assertEquals(0, beans.size());
         return beans;
     }
     
@@ -186,7 +186,7 @@ public class JMXEnv {
             for (ObjectName bean : beans) {
                 LOG.info("bean:" + bean.toString());
             }
-            TestCase.fail(unexpectedName);
+            Assert.fail(unexpectedName);
         }
     }
 
@@ -250,7 +250,7 @@ public class JMXEnv {
                 beans.removeAll(found);
             }
         } while (expectedNames.length != found.size() && nTry < 120);
-        TestCase.assertEquals("expected " + Arrays.toString(expectedNames),
+        Assert.assertEquals("expected " + Arrays.toString(expectedNames),
                 expectedNames.length, found.size());
         return beans;
     }
@@ -296,7 +296,7 @@ public class JMXEnv {
                 }
             }
         } while (nTry < 120);
-        TestCase.fail("Failed to find bean:" + expectedName + ", attribute:"
+        Assert.fail("Failed to find bean:" + expectedName + ", attribute:"
                 + expectedAttribute);
         return value;
     }

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/MultiTransactionTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/MultiTransactionTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/MultiTransactionTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/MultiTransactionTest.java Tue Jul  7 05:11:49 2015
@@ -46,6 +46,7 @@ import org.apache.zookeeper.OpResult.Set
 import org.apache.zookeeper.ZooDefs.Ids;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.SyncRequestProcessor;
+import org.apache.zookeeper.ZKParameterized;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -54,6 +55,7 @@ import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
 @RunWith(Parameterized.class)
+@Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
 public class MultiTransactionTest extends ClientBase {
     private static final Logger LOG = Logger.getLogger(MultiTransactionTest.class);
     private ZooKeeper zk;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/OSMXBeanTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/OSMXBeanTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/OSMXBeanTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/OSMXBeanTest.java Tue Jul  7 05:11:49 2015
@@ -18,6 +18,7 @@
 
 package org.apache.zookeeper.test;
 
+import org.apache.zookeeper.ZKTestCase;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.Before;
@@ -26,7 +27,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.zookeeper.server.util.OSMXBean;
 
-public class OSMXBeanTest {
+public class OSMXBeanTest extends ZKTestCase {
     
     private OSMXBean osMbean;
     private Long ofdc = 0L;

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ReadOnlyModeTest.java Tue Jul  7 05:11:49 2015
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Pattern;
 
-import junit.framework.Assert;
 
 import org.apache.log4j.Layout;
 import org.apache.log4j.Level;
@@ -45,6 +44,7 @@ import org.apache.zookeeper.ZooKeeper.St
 import org.apache.zookeeper.common.Time;
 import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/SessionInvalidationTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/SessionInvalidationTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/SessionInvalidationTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/SessionInvalidationTest.java Tue Jul  7 05:11:49 2015
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.Socket;
 
-import junit.framework.Assert;
 
 import org.apache.jute.BinaryOutputArchive;
 import org.apache.zookeeper.ZooDefs;
@@ -33,6 +32,7 @@ import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.proto.ConnectRequest;
 import org.apache.zookeeper.proto.CreateRequest;
 import org.apache.zookeeper.proto.RequestHeader;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class SessionInvalidationTest extends ClientBase {

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StringUtilTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StringUtilTest.java?rev=1689571&r1=1689570&r2=1689571&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StringUtilTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/StringUtilTest.java Tue Jul  7 05:11:49 2015
@@ -18,14 +18,15 @@
 package org.apache.zookeeper.test;
 
 
+import org.apache.zookeeper.ZKTestCase;
 import org.apache.zookeeper.common.StringUtils;
 import org.junit.Test;
 
 import java.util.Arrays;
 
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
 
-public class StringUtilTest {
+public class StringUtilTest extends ZKTestCase {
 
     @Test
     public void testStrings() {



Mime
View raw message