zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f..@apache.org
Subject svn commit: r1612972 [2/2] - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/ bookkeeper-server/src/test/java/org/apache/bookkeeper/client/ bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/ book...
Date Wed, 23 Jul 2014 23:41:22 GMT
Modified: zookeeper/bookkeeper/trunk/hedwig-client/src/test/java/org/apache/hedwig/util/TestPathUtils.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-client/src/test/java/org/apache/hedwig/util/TestPathUtils.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-client/src/test/java/org/apache/hedwig/util/TestPathUtils.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-client/src/test/java/org/apache/hedwig/util/TestPathUtils.java
Wed Jul 23 23:41:19 2014
@@ -19,11 +19,11 @@ package org.apache.hedwig.util;
 
 import java.util.Arrays;
 
-import junit.framework.TestCase;
-
 import org.junit.Test;
 
-public class TestPathUtils extends TestCase {
+import static org.junit.Assert.*;
+
+public class TestPathUtils {
 
     @Test(timeout=60000)
     public void testPrefixes() {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestPubSubClient.java
Wed Jul 23 23:41:19 2014
@@ -36,7 +36,6 @@ import org.junit.runners.Parameterized.P
 import com.google.protobuf.ByteString;
 import org.apache.hedwig.client.api.MessageHandler;
 import org.apache.hedwig.client.conf.ClientConfiguration;
-import org.apache.hedwig.client.HedwigClient;
 import org.apache.hedwig.client.api.Publisher;
 import org.apache.hedwig.client.api.Subscriber;
 import org.apache.hedwig.exceptions.PubSubException;
@@ -53,6 +52,8 @@ import org.apache.hedwig.util.Concurrenc
 import org.apache.hedwig.util.SubscriptionListener;
 import org.apache.hedwig.util.HedwigSocketAddress;
 
+import static org.junit.Assert.*;
+
 @RunWith(Parameterized.class)
 public class TestPubSubClient extends PubSubServerStandAloneTestBase {
 
@@ -230,7 +231,7 @@ public class TestPubSubClient extends Pu
                                              Message msg, Callback<Void> callback,
                                              Object context) {
                 String str = msg.getBody().toStringUtf8();
-                receivedMsgs.put(str, msg.getMsgId()); 
+                receivedMsgs.put(str, msg.getMsgId());
                 if (numMessages == numReceived.incrementAndGet()) {
                     receiveLatch.countDown();
                 }
@@ -296,7 +297,7 @@ public class TestPubSubClient extends Pu
                                              Message msg, Callback<Void> callback,
                                              Object context) {
                 String str = msg.getBody().toStringUtf8();
-                receivedMsgs.put(str, msg.getMsgId()); 
+                receivedMsgs.put(str, msg.getMsgId());
                 if (numMessages == numReceived.incrementAndGet()) {
                     receiveLatch.countDown();
                 }

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestSubAfterCloseSub.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestSubAfterCloseSub.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestSubAfterCloseSub.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/TestSubAfterCloseSub.java
Wed Jul 23 23:41:19 2014
@@ -37,6 +37,8 @@ import org.junit.Test;
 
 import com.google.protobuf.ByteString;
 
+import static org.junit.Assert.*;
+
 public class TestSubAfterCloseSub extends HedwigHubTestBase {
 
     class TestClientConfiguration extends HubClientConfiguration {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/netty/TestMultiplexing.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/netty/TestMultiplexing.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/netty/TestMultiplexing.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/client/netty/TestMultiplexing.java
Wed Jul 23 23:41:19 2014
@@ -26,7 +26,6 @@ import org.junit.Test;
 
 import com.google.protobuf.ByteString;
 import org.apache.hedwig.client.api.MessageHandler;
-import org.apache.hedwig.client.conf.ClientConfiguration;
 import org.apache.hedwig.client.HedwigClient;
 import org.apache.hedwig.client.api.Publisher;
 import org.apache.hedwig.client.api.Subscriber;
@@ -38,6 +37,8 @@ import org.apache.hedwig.server.HedwigHu
 import org.apache.hedwig.server.common.ServerConfiguration;
 import org.apache.hedwig.util.Callback;
 
+import static org.junit.Assert.*;
+
 public class TestMultiplexing extends HedwigHubTestBase {
 
     private static final int DEFAULT_MSG_WINDOW_SIZE = 10;

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigHubTestBase.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigHubTestBase.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigHubTestBase.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigHubTestBase.java
Wed Jul 23 23:41:19 2014
@@ -21,7 +21,6 @@ import java.util.LinkedList;
 import java.util.List;
 
 import junit.framework.TestCase;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.junit.After;
@@ -74,7 +73,6 @@ public abstract class HedwigHubTestBase 
     }
 
     public HedwigHubTestBase(String name, int numServers) {
-        super(name);
         this.numServers = numServers;
         init();
     }
@@ -172,10 +170,9 @@ public abstract class HedwigHubTestBase 
         serversList.clear();
     }
 
-    @Override
     @Before
     protected void setUp() throws Exception {
-        logger.info("STARTING " + getName());
+        logger.info("STARTING " + getClass());
         if (! standalone) {
             bktb = new BookKeeperTestBase(numBookies, readDelay);
             bktb.setUp();
@@ -184,13 +181,12 @@ public abstract class HedwigHubTestBase 
         logger.info("HedwigHub test setup finished");
     }
 
-    @Override
     @After
     protected void tearDown() throws Exception {
         logger.info("tearDown starting");
         stopHubServers();
         if (null != bktb) bktb.tearDown();
-        logger.info("FINISHED " + getName());
+        logger.info("FINISHED " + getClass());
     }
 
 }

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigRegionTestBase.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigRegionTestBase.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigRegionTestBase.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/HedwigRegionTestBase.java
Wed Jul 23 23:41:19 2014
@@ -22,8 +22,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.junit.After;
@@ -35,7 +33,6 @@ import org.apache.hedwig.server.common.S
 import org.apache.hedwig.server.netty.PubSubServer;
 import org.apache.hedwig.server.persistence.BookKeeperTestBase;
 import org.apache.hedwig.util.HedwigSocketAddress;
-import org.apache.hedwig.server.LoggingExceptionHandler;
 
 import org.apache.bookkeeper.test.PortManager;
 
@@ -45,7 +42,7 @@ import org.apache.bookkeeper.test.PortMa
  * the required BookKeeper and ZooKeeper instances.
  *
  */
-public abstract class HedwigRegionTestBase extends TestCase {
+public abstract class HedwigRegionTestBase {
 
     protected static Logger logger = LoggerFactory.getLogger(HedwigRegionTestBase.class);
 
@@ -182,10 +179,9 @@ public abstract class HedwigRegionTestBa
         };
     }
 
-    @Override
     @Before
     public void setUp() throws Exception {
-        logger.info("STARTING " + getName());
+        logger.info("STARTING " + getClass());
         bktb = new BookKeeperTestBase(numBookies);
         bktb.setUp();
 
@@ -211,7 +207,6 @@ public abstract class HedwigRegionTestBa
         logger.info("HedwigRegion test setup finished");
     }
 
-    @Override
     @After
     public void tearDown() throws Exception {
         logger.info("tearDown starting");
@@ -230,7 +225,7 @@ public abstract class HedwigRegionTestBa
         regionServersMap.clear();
         // Shutdown the BookKeeper and ZooKeeper stuff
         bktb.tearDown();
-        logger.info("FINISHED " + getName());
+        logger.info("FINISHED " + getClass());
     }
 
     protected void stopRegion(int regionIdx) throws Exception {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/PubSubServerStandAloneTestBase.java
Wed Jul 23 23:41:19 2014
@@ -17,8 +17,6 @@
  */
 package org.apache.hedwig.server;
 
-import junit.framework.TestCase;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.junit.After;
@@ -27,7 +25,6 @@ import org.junit.Before;
 import org.apache.bookkeeper.test.PortManager;
 
 import org.apache.hedwig.client.conf.ClientConfiguration;
-import org.apache.hedwig.server.LoggingExceptionHandler;
 import org.apache.hedwig.server.common.ServerConfiguration;
 import org.apache.hedwig.server.netty.PubSubServer;
 import org.apache.hedwig.util.HedwigSocketAddress;
@@ -35,7 +32,7 @@ import org.apache.hedwig.util.HedwigSock
 /**
  * This is a base class for any tests that need a StandAlone PubSubServer setup.
  */
-public abstract class PubSubServerStandAloneTestBase extends TestCase {
+public abstract class PubSubServerStandAloneTestBase {
 
     protected static Logger logger = LoggerFactory.getLogger(PubSubServerStandAloneTestBase.class);
 
@@ -67,22 +64,20 @@ public abstract class PubSubServerStandA
     protected ServerConfiguration conf;
     protected HedwigSocketAddress defaultAddress;
 
-    @Override
     @Before
     public void setUp() throws Exception {
-        logger.info("STARTING " + getName());
+        logger.info("STARTING " + getClass());
         conf = getStandAloneServerConfiguration();
         startHubServer(conf);
         logger.info("Standalone PubSubServer test setup finished");
     }
 
 
-    @Override
     @After
     public void tearDown() throws Exception {
         logger.info("tearDown starting");
         tearDownHubServer();
-        logger.info("FINISHED " + getName());
+        logger.info("FINISHED " + getClass());
     }
 
     protected HedwigSocketAddress getDefaultHedwigAddress() {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/TestBackwardCompat.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/TestBackwardCompat.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/TestBackwardCompat.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/TestBackwardCompat.java
Wed Jul 23 23:41:19 2014
@@ -19,7 +19,6 @@ package org.apache.hedwig.server;
 
 import java.net.InetAddress;
 import java.io.File;
-import java.io.IOException;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -28,8 +27,6 @@ import java.util.concurrent.atomic.Atomi
 
 import com.google.protobuf.ByteString;
 
-import junit.framework.TestCase;
-
 import org.junit.Test;
 import static org.junit.Assert.*;
 
@@ -39,14 +36,13 @@ import org.apache.bookkeeper.test.PortMa
 import org.apache.hedwig.util.HedwigSocketAddress;
 
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * Test Backward Compatability between different versions
  */
-public class TestBackwardCompat extends TestCase {
+public class TestBackwardCompat {
 
     private static Logger logger = LoggerFactory.getLogger(TestBackwardCompat.class);
 

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/delivery/TestThrottlingDelivery.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/delivery/TestThrottlingDelivery.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/delivery/TestThrottlingDelivery.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/delivery/TestThrottlingDelivery.java
Wed Jul 23 23:41:19 2014
@@ -54,6 +54,8 @@ import org.junit.runners.Parameterized.P
 
 import com.google.protobuf.ByteString;
 
+import static org.junit.Assert.*;
+
 @RunWith(Parameterized.class)
 public class TestThrottlingDelivery extends HedwigHubTestBase {
 

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestBaseHandler.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestBaseHandler.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestBaseHandler.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestBaseHandler.java
Wed Jul 23 23:41:19 2014
@@ -18,7 +18,6 @@
 package org.apache.hedwig.server.handlers;
 
 import java.util.List;
-import junit.framework.TestCase;
 
 import org.jboss.netty.channel.Channel;
 import org.junit.Before;
@@ -32,7 +31,9 @@ import org.apache.hedwig.server.netty.Wr
 import org.apache.hedwig.server.topics.StubTopicManager;
 import org.apache.hedwig.server.topics.TopicManager;
 
-public class TestBaseHandler extends TestCase {
+import static org.junit.Assert.*;
+
+public class TestBaseHandler {
 
     MyBaseHandler handler;
     StubTopicManager tm;
@@ -58,7 +59,6 @@ public class TestBaseHandler extends Tes
 
     }
 
-    @Override
     @Before
     public void setUp() throws Exception {
         ServerConfiguration conf = new ServerConfiguration();

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/handlers/TestSubUnsubHandler.java
Wed Jul 23 23:41:19 2014
@@ -21,6 +21,8 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
+
+import org.junit.Before;
 import org.junit.Test;
 
 import com.google.protobuf.ByteString;
@@ -51,9 +53,9 @@ import org.apache.hedwig.server.topics.T
 import org.apache.hedwig.server.topics.TrivialOwnAllTopicManager;
 import org.apache.hedwig.util.ConcurrencyUtils;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
 
-public class TestSubUnsubHandler extends TestCase {
+public class TestSubUnsubHandler {
 
     SubscribeHandler sh;
     StubDeliveryManager dm;
@@ -67,10 +69,8 @@ public class TestSubUnsubHandler extends
     ByteString subscriberId;
     UnsubscribeHandler ush;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
+    @Before
+    public void setUp() throws Exception {
         ServerConfiguration conf = new ServerConfiguration();
         ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
 

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigHub.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigHub.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigHub.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigHub.java
Wed Jul 23 23:41:19 2014
@@ -18,8 +18,6 @@
 package org.apache.hedwig.server.integration;
 
 import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.concurrent.SynchronousQueue;
 
@@ -36,7 +34,6 @@ import org.apache.hedwig.client.exceptio
 import org.apache.hedwig.client.HedwigClient;
 import org.apache.hedwig.client.api.Client;
 import org.apache.hedwig.client.api.Publisher;
-import org.apache.hedwig.client.api.Subscriber;
 import org.apache.hedwig.exceptions.PubSubException;
 import org.apache.hedwig.exceptions.PubSubException.ClientNotSubscribedException;
 import org.apache.hedwig.protocol.PubSubProtocol.Message;
@@ -62,6 +59,8 @@ import org.apache.hedwig.util.HedwigSock
 import org.apache.bookkeeper.test.PortManager;
 import org.apache.hedwig.server.LoggingExceptionHandler;
 
+import static org.junit.Assert.*;
+
 public abstract class TestHedwigHub extends HedwigHubTestBase {
 
     // Client side variables

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigRegion.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigRegion.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigRegion.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/integration/TestHedwigRegion.java
Wed Jul 23 23:41:19 2014
@@ -23,7 +23,6 @@ import java.util.Map;
 import java.util.Random;
 import java.util.concurrent.SynchronousQueue;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -43,6 +42,8 @@ import org.apache.hedwig.server.integrat
 import org.apache.hedwig.server.integration.TestHedwigHub.TestMessageHandler;
 import org.apache.hedwig.util.HedwigSocketAddress;
 
+import static org.junit.Assert.*;
+
 @RunWith(Parameterized.class)
 public class TestHedwigRegion extends HedwigRegionTestBase {
 
@@ -220,7 +221,7 @@ public class TestHedwigRegion extends He
     @Test(timeout=60000)
     public void testAttachExistingSubscriptionsWhenARegionDown() throws Exception {
         int batchSize = 10;
-        
+
         SubscriptionOptions opts = SubscriptionOptions.newBuilder()
             .setCreateOrAttach(CreateOrAttach.CREATE_OR_ATTACH).build();
 
@@ -286,7 +287,7 @@ public class TestHedwigRegion extends He
 
         // Now start publishing messages for the subscribed topics in one of the
         // regions and verify that it gets delivered and consumed in all of the
-        // other ones.        
+        // other ones.
         Publisher publisher = client.getPublisher();
         for (int i = 0; i < batchSize; i++) {
             publisher.asyncPublish(ByteString.copyFromUtf8("Topic" + i), Message.newBuilder().setBody(

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestPubSubServer.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestPubSubServer.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestPubSubServer.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/netty/TestPubSubServer.java
Wed Jul 23 23:41:19 2014
@@ -47,6 +47,8 @@ import org.apache.hedwig.util.Callback;
 import org.apache.hedwig.util.HedwigSocketAddress;
 import org.apache.hedwig.zookeeper.SafeAsyncZKCallback;
 
+import static org.junit.Assert.*;
+
 public class TestPubSubServer extends PubSubServerStandAloneTestBase {
 
     @Test(timeout=60000)

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManager.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManager.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManager.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManager.java
Wed Jul 23 23:41:19 2014
@@ -31,8 +31,6 @@ import java.util.concurrent.ScheduledExe
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-import junit.framework.TestCase;
-
 import org.apache.bookkeeper.versioning.Version;
 import org.apache.bookkeeper.versioning.Versioned;
 
@@ -70,8 +68,10 @@ import org.slf4j.LoggerFactory;
 
 import com.google.protobuf.ByteString;
 
+import static org.junit.Assert.*;
+
 @RunWith(Parameterized.class)
-public class TestBookKeeperPersistenceManager extends TestCase {
+public class TestBookKeeperPersistenceManager {
     static Logger logger = LoggerFactory.getLogger(TestPersistenceManagerBlackBox.class);
 
     BookKeeperTestBase bktb;
@@ -300,18 +300,14 @@ public class TestBookKeeperPersistenceMa
         bktb.tearDown();
     }
 
-    @Override
     @Before
     public void setUp() throws Exception {
-        super.setUp();
         startCluster(0L);
     }
 
-    @Override
     @After
     public void tearDown() throws Exception {
         stopCluster();
-        super.tearDown();
     }
 
     class RangeScanVerifier implements ScanCallback {
@@ -497,7 +493,7 @@ public class TestBookKeeperPersistenceMa
         Boolean b = statusQueue.poll(10 * readDelay, TimeUnit.MILLISECONDS);
         assertTrue("Should succeed to scan messages after deleted consumed ledger.", b);
 
-        // consumed 
+        // consumed
         consumedUntil(topic, (numLedgers + 1) * 2L);
         // Wait until ledger ranges is updated.
         Thread.sleep(2000L);

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManagerBlackBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManagerBlackBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManagerBlackBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookKeeperPersistenceManagerBlackBox.java
Wed Jul 23 23:41:19 2014
@@ -36,9 +36,9 @@ public class TestBookKeeperPersistenceMa
 
     MetadataManagerFactory metadataManagerFactory = null;
 
-    @Override
     @Before
-    protected void setUp() throws Exception {
+    @Override
+    public void setUp() throws Exception {
         // We need to setUp this class first since the super.setUp() method will
         // need the BookKeeperTestBase to be instantiated.
         bktb = new BookKeeperTestBase(numBookies);
@@ -46,9 +46,10 @@ public class TestBookKeeperPersistenceMa
         super.setUp();
     }
 
-    @Override
+
     @After
-    protected void tearDown() throws Exception {
+    @Override
+    public void tearDown() throws Exception {
         bktb.tearDown();
         super.tearDown();
         if (null != metadataManagerFactory) {
@@ -79,8 +80,4 @@ public class TestBookKeeperPersistenceMa
         return numPublished;
     }
 
-    public static Test suite() {
-        return new TestSuite(TestBookKeeperPersistenceManagerBlackBox.class);
-    }
-
 }

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
Wed Jul 23 23:41:19 2014
@@ -22,8 +22,6 @@ import java.util.Random;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 
-import junit.framework.TestCase;
-
 import org.apache.bookkeeper.client.BookKeeper;
 import org.apache.hedwig.protocol.PubSubProtocol;
 import org.apache.hedwig.protocol.PubSubProtocol.MessageSeqId;
@@ -46,7 +44,9 @@ import org.apache.hedwig.util.Concurrenc
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TestBookkeeperPersistenceManagerWhiteBox extends TestCase {
+import static org.junit.Assert.*;
+
+public class TestBookkeeperPersistenceManagerWhiteBox {
 
     protected static Logger logger =
         LoggerFactory.getLogger(TestBookkeeperPersistenceManagerWhiteBox.class);
@@ -60,10 +60,8 @@ public class TestBookkeeperPersistenceMa
     TopicManager tm;
     ByteString topic = ByteString.copyFromUtf8("topic0");
 
-    @Override
     @Before
-    protected void setUp() throws Exception {
-        super.setUp();
+    public void setUp() throws Exception {
         bktb = new BookKeeperTestBase(numBookies);
         bktb.setUp();
 
@@ -76,12 +74,10 @@ public class TestBookkeeperPersistenceMa
         bkpm = new BookkeeperPersistenceManager(bktb.bk, mm, tm, conf, scheduler);
     }
 
-    @Override
     @After
-    protected void tearDown() throws Exception {
+    public void tearDown() throws Exception {
         mm.shutdown();
         bktb.tearDown();
-        super.tearDown();
     }
 
     @Test(timeout=60000)

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestDeadlock.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestDeadlock.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestDeadlock.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestDeadlock.java
Wed Jul 23 23:41:19 2014
@@ -33,7 +33,6 @@ import org.apache.hedwig.client.api.Mess
 import org.apache.hedwig.client.api.Publisher;
 import org.apache.hedwig.client.api.Subscriber;
 import org.apache.hedwig.exceptions.PubSubException;
-import org.apache.hedwig.client.conf.ClientConfiguration;
 import org.apache.hedwig.client.HedwigClient;
 import org.apache.hedwig.protocol.PubSubProtocol.Message;
 import org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest.CreateOrAttach;

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestLocalDBPersistenceManagerBlackBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestLocalDBPersistenceManagerBlackBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestLocalDBPersistenceManagerBlackBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestLocalDBPersistenceManagerBlackBox.java
Wed Jul 23 23:41:19 2014
@@ -20,17 +20,24 @@ package org.apache.hedwig.server.persist
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.apache.hedwig.server.persistence.LocalDBPersistenceManager;
-import org.apache.hedwig.server.persistence.PersistenceManager;
+import org.junit.After;
+import org.junit.Before;
 
 public class TestLocalDBPersistenceManagerBlackBox extends TestPersistenceManagerBlackBox
{
 
+    @After
     @Override
-    protected void tearDown() throws Exception {
+    public void tearDown() throws Exception {
         super.tearDown();
         ((LocalDBPersistenceManager) persistenceManager).reset();
     }
 
+    @Before
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
     @Override
     long getLowestSeqId() {
         return 1;
@@ -46,8 +53,4 @@ public class TestLocalDBPersistenceManag
         return numPublished;
     }
 
-    public static Test suite() {
-        return new TestSuite(TestLocalDBPersistenceManagerBlackBox.class);
-    }
-
 }

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestPersistenceManagerBlackBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestPersistenceManagerBlackBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestPersistenceManagerBlackBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestPersistenceManagerBlackBox.java
Wed Jul 23 23:41:19 2014
@@ -23,8 +23,6 @@ import java.util.concurrent.LinkedBlocki
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
-import junit.framework.TestCase;
-
 import org.apache.hedwig.protocol.PubSubProtocol;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,7 +35,9 @@ import org.apache.hedwig.protocol.PubSub
 import org.apache.hedwig.server.topics.TopicOwnershipChangeListener;
 import org.apache.hedwig.util.Callback;
 
-public abstract class TestPersistenceManagerBlackBox extends TestCase {
+import static org.junit.Assert.*;
+
+public abstract class TestPersistenceManagerBlackBox {
     protected PersistenceManager persistenceManager;
     protected int NUM_MESSAGES_TO_TEST = 5;
     protected int NUM_TOPICS_TO_TEST = 5;
@@ -215,9 +215,8 @@ public abstract class TestPersistenceMan
 
     }
 
-    @Override
-    protected void setUp() throws Exception {
-        logger.info("STARTING " + getName());
+    public void setUp() throws Exception {
+        logger.info("STARTING " + getClass());
         persistenceManager = instantiatePersistenceManager();
         failureException = null;
         logger.info("Persistence Manager test setup finished");
@@ -227,12 +226,10 @@ public abstract class TestPersistenceMan
 
     abstract PersistenceManager instantiatePersistenceManager() throws Exception;
 
-    @Override
-    protected void tearDown() throws Exception {
+    public void tearDown() throws Exception {
         logger.info("tearDown starting");
         persistenceManager.stop();
-        super.tearDown();
-        logger.info("FINISHED " + getName());
+        logger.info("FINISHED " + getClass());
     }
 
     protected ByteString getTopicName(int number) {

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheBlackBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheBlackBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheBlackBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheBlackBox.java
Wed Jul 23 23:41:19 2014
@@ -21,18 +21,24 @@ import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.apache.hedwig.server.common.ServerConfiguration;
-import org.apache.hedwig.server.persistence.LocalDBPersistenceManager;
-import org.apache.hedwig.server.persistence.PersistenceManager;
-import org.apache.hedwig.server.persistence.ReadAheadCache;
+import org.junit.After;
+import org.junit.Before;
 
 public class TestReadAheadCacheBlackBox extends TestPersistenceManagerBlackBox {
 
+    @After
     @Override
-    protected void tearDown() throws Exception {
+    public void tearDown() throws Exception {
         super.tearDown();
         LocalDBPersistenceManager.instance().reset();
     }
 
+    @Before
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+    }
+
     @Override
     long getExpectedSeqId(int numPublished) {
         return numPublished;
@@ -48,7 +54,4 @@ public class TestReadAheadCacheBlackBox 
         return new ReadAheadCache(LocalDBPersistenceManager.instance(), new ServerConfiguration()).start();
     }
 
-    public static Test suite() {
-        return new TestSuite(TestReadAheadCacheBlackBox.class);
-    }
 }

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheWhiteBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheWhiteBox.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheWhiteBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestReadAheadCacheWhiteBox.java
Wed Jul 23 23:41:19 2014
@@ -94,11 +94,6 @@ public class TestReadAheadCacheWhiteBox 
         cacheBasedPersistenceManager = new MyReadAheadCache(stubPersistenceManager, myConf).start();
     }
 
-    @After
-    public void tearDown() throws Exception {
-
-    }
-
     @Test(timeout=60000)
     public void testPersistMessage() throws Exception {
         StubCallback<PubSubProtocol.MessageSeqId> callback = new StubCallback<PubSubProtocol.MessageSeqId>();

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestUpdateSubscriptionState.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestUpdateSubscriptionState.java?rev=1612972&r1=1612971&r2=1612972&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestUpdateSubscriptionState.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/subscriptions/TestUpdateSubscriptionState.java
Wed Jul 23 23:41:19 2014
@@ -23,7 +23,6 @@ import org.apache.hedwig.client.HedwigCl
 import org.apache.hedwig.client.api.MessageHandler;
 import org.apache.hedwig.client.api.Publisher;
 import org.apache.hedwig.client.api.Subscriber;
-import org.apache.hedwig.client.conf.ClientConfiguration;
 import org.apache.hedwig.protocol.PubSubProtocol.Message;
 import org.apache.hedwig.protocol.PubSubProtocol.SubscriptionOptions;
 import org.apache.hedwig.protocol.PubSubProtocol.SubscribeRequest.CreateOrAttach;
@@ -31,13 +30,14 @@ import org.apache.hedwig.server.HedwigHu
 import org.apache.hedwig.server.common.ServerConfiguration;
 import org.apache.hedwig.util.Callback;
 import org.apache.hedwig.util.ConcurrencyUtils;
-import org.apache.hedwig.util.HedwigSocketAddress;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 import com.google.protobuf.ByteString;
 
+import static org.junit.Assert.*;
+
 public class TestUpdateSubscriptionState extends HedwigHubTestBase {
 
     private static final int RETENTION_SECS_VALUE = 100;



Mime
View raw message