geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [14/54] [abbrv] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4
Date Thu, 09 Jun 2016 18:49:42 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
index b756100..b191a85 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListDUnitTest.java
@@ -16,7 +16,35 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.ClientSession;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationListener;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.NoSubscriptionServersAvailableException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
@@ -26,16 +54,17 @@ import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.AssertionFailedError;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test Scenario :
@@ -72,56 +101,68 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * then both client connects to the server
  * c1 register(k1,k2,k3) and c2 register (k4,k5)
  * then verify that updates has occurred as a result of interest registration.
- *
- *
- *
  */
-public class InterestListDUnitTest extends DistributedTestCase
-{
-  static Cache cache = null;
-
-  VM vm0 = null;
-
-  VM vm1 = null;
+@Category(DistributedTest.class)
+public class InterestListDUnitTest extends JUnit4DistributedTestCase {
 
-  VM vm2 = null;
-
-  /** the server cache's port number */
-  int PORT1;
+  private static final String REGION_NAME = "InterestListDUnitTest_region";
 
-  // using a Integer instead of String to make sure ALL_KEYS works
-  // on non-String keys
-  final static Integer key1 = new Integer(1);
-  final static Integer key2 = new Integer(2);
-  final static String key1_originalValue = "key-1-orig-value";
-  final static String key2_originalValue = "key-2-orig-value";
+  // using a Integer instead of String to make sure ALL_KEYS works on non-String keys
+  private final static Integer key1 = new Integer(1);
+  private final static Integer key2 = new Integer(2);
+  private final static String key1_originalValue = "key-1-orig-value";
+  private final static String key2_originalValue = "key-2-orig-value";
 
-  static final String REGION_NAME = "InterestListDUnitTest_region";
+  private static Cache cache = null;
 
   /** some tests use this to hold the server for invoke() access */
-  static CacheServer server;
+  private static CacheServer server;
 
   /** interestListener listens in cache server vms */
-  static InterestListener interestListener;
+  private static InterestListener interestListener;
 
-  /** constructor */
-  public InterestListDUnitTest(String name) {
-    super(name);
-  }
+  private VM vm0 = null;
+  private VM vm1 = null;
+  private VM vm2 = null;
+
+  /** the server cache's port number */
+  private int PORT1;
 
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
-    Wait.pause(10000);
+
     final Host host = Host.getHost(0);
     vm0 = host.getVM(0);
     vm1 = host.getVM(1);
     vm2 = host.getVM(2);
+
     // start servers first
-    PORT1 =  ((Integer) vm0.invoke(() -> InterestListDUnitTest.createServerCache())).intValue();
+    PORT1 = vm0.invoke(() -> InterestListDUnitTest.createServerCache());
   }
 
-/**
+  @Override
+  public final void preTearDown() throws Exception {
+    // close the clients first
+    vm1.invoke(() -> InterestListDUnitTest.closeCache());
+    vm2.invoke(() -> InterestListDUnitTest.closeCache());
+    // then close the servers
+    vm0.invoke(() -> InterestListDUnitTest.closeCache());
+
+    cache = null;
+    server = null;
+    interestListener = null;
+
+    Invoke.invokeInEveryVM(new SerializableRunnable() {
+      public void run() {
+        cache = null;
+        server = null;
+        interestListener = null;
+      }
+    });
+  }
+
+  /**
    * one server two clients
    * create Entries in all the vms
    * c1 : register (k1)
@@ -136,67 +177,64 @@ public class InterestListDUnitTest extends DistributedTestCase
    * c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
    * c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
    * c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
-   *
    */
-    public void testInterestListRegistration()
-    {
-
-      vm1.invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
-      vm2.invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
-
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-
-      vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
-
-      vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
-      Wait.pause(10000);
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
-      Wait.pause(10000);
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
-
-      vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
-
-      vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
-      Wait.pause(10000);
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
-      Wait.pause(10000);
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
-    }
+  @Test
+  public void testInterestListRegistration() throws Exception {
+    vm1.invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
+    vm2.invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
 
-/**
- * one server two clients
- * create Entries in all the vms
- *
- * STEP 1:
- * c2:  put (k2 -> vm-k2)
- * c1:  validate k2 == k2 (not updated because no interest)
- *
- * STEP 2
- * c1:  register k2
- * c1 : validate k2 == vm-k2 (updated because of registerInterest)
- * c1:  validate k1 == k1 (other key not updated because still no interest)
- *
- * STEP 3:
- * c1:  put (k1 -> vm-k1)
- * c2:  validate k1 == k1 (not updated because no interest)
- * c2:  register k1
- * c2:  validate k1 == vm-k1 (updated because of registerInterest)
- *
- * STEP 4:
- * c2:  unregister k1
- * c1:  put k1->k1 (old value)
- * c2:  validate k1 == vm-k1 (no interest, so missing update)
- */
-  public void testValueRefresh()
-  {
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
+    vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
+
+    vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
+    Wait.pause(10000);
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
+    Wait.pause(10000);
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
+
+    vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
+
+    vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
+    Wait.pause(10000);
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
+    Wait.pause(10000);
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
+  }
+
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   *
+   * STEP 1:
+   * c2:  put (k2 -> vm-k2)
+   * c1:  validate k2 == k2 (not updated because no interest)
+   *
+   * STEP 2
+   * c1:  register k2
+   * c1 : validate k2 == vm-k2 (updated because of registerInterest)
+   * c1:  validate k1 == k1 (other key not updated because still no interest)
+   *
+   * STEP 3:
+   * c1:  put (k1 -> vm-k1)
+   * c2:  validate k1 == k1 (not updated because no interest)
+   * c2:  register k1
+   * c2:  validate k1 == vm-k1 (updated because of registerInterest)
+   *
+   * STEP 4:
+   * c2:  unregister k1
+   * c1:  put k1->k1 (old value)
+   * c2:  validate k1 == vm-k1 (no interest, so missing update)
+   */
+  @Test
+  public void testValueRefresh() throws Exception {
     // Initialization
     Host host = Host.getHost(0);
     vm1.invoke(() -> InterestListDUnitTest.createClientCache( NetworkUtils.getServerHostName(host), new Integer(PORT1)));
@@ -234,15 +272,13 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm2.invoke(() -> InterestListDUnitTest.validateSingleEntry(key1, "vm1")); // update lost
   }
 
-/**
- * one server two clients
- * create Entries in all the vms
- * register ALL_KEYS and verifies that updates are receiving to all the keys
- *
- */
-  public void testInterestListRegistration_ALL_KEYS()
-  {
-
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   * register ALL_KEYS and verifies that updates are receiving to all the keys
+   */
+  @Test
+  public void testInterestListRegistration_ALL_KEYS() throws Exception {
     vm1.invoke(() -> InterestListDUnitTest.createClientCache(
       NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1)));
     vm2.invoke(() -> InterestListDUnitTest.createClientCache(
@@ -256,19 +292,18 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.put_ALL_KEYS());
     Wait.pause(10000);
     vm2.invoke(() -> InterestListDUnitTest.validate_ALL_KEYS());
-
   }
- /**
-  * one server two clients
-  * create Entries in all the vms
-  * server directly puts some values
-  * then both clients connect to the server
-  * c1 register(k1,k2,k3) and c2 register (k4,k5)
-  * then verify that updates has occured as a result of interest registration.
-  *
-  */
-  public void testInitializationOfRegionFromInterestList()
-  {
+
+  /**
+   * one server two clients
+   * create Entries in all the vms
+   * server directly puts some values
+   * then both clients connect to the server
+   * c1 register(k1,k2,k3) and c2 register (k4,k5)
+   * then verify that updates has occured as a result of interest registration.
+   */
+  @Test
+  public void testInitializationOfRegionFromInterestList() throws Exception {
     // directly put on server
     vm0.invoke(() -> InterestListDUnitTest.multiple_put());
     Wait.pause(1000);
@@ -285,7 +320,6 @@ public class InterestListDUnitTest extends DistributedTestCase
     // verify the values for registered keys
     vm1.invoke(() -> InterestListDUnitTest.validateRegionEntriesFromInterestListInVm1());
     vm2.invoke(() -> InterestListDUnitTest.validateRegionEntriesFromInterestListInVm2());
-
   }
 
   /**
@@ -303,126 +337,124 @@ public class InterestListDUnitTest extends DistributedTestCase
    * c2 : validate (k1 == vm2-k1) AND (k2 == vm2-k2) // as both are not registered
    * c2 : put (k1 -> vm2-k1-again) AND (k2 -> vm2-k2-again)
    * c1 : validate (k1 == vm1-k1-again) AND (k2 == vm1-k2-again)// as both are not registered
-   *
    */
-    public void testInterestListRegistrationOnServer()
-    {
-
-      DistributedMember c1 = (DistributedMember)vm1
-        .invoke(() -> InterestListDUnitTest.createClientCache(
-          NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
-      DistributedMember c2 = (DistributedMember)vm2
-        .invoke(() -> InterestListDUnitTest.createClientCache(
-          NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
+  @Test
+  public void testInterestListRegistrationOnServer() throws Exception {
+    DistributedMember c1 = (DistributedMember)vm1
+      .invoke(() -> InterestListDUnitTest.createClientCache(
+        NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
+    DistributedMember c2 = (DistributedMember)vm2
+      .invoke(() -> InterestListDUnitTest.createClientCache(
+        NetworkUtils.getServerHostName(vm0.getHost()), PORT1));
 
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.put( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.put( "vm2" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesK1andK2( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
 
-      vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
+    vm1.invoke(() -> InterestListDUnitTest.putAgain( "vm1" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
-      vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm2" ));
+    vm2.invoke(() -> InterestListDUnitTest.putAgain( "vm2" ));
 
-      vm0.invoke(() -> InterestListDUnitTest.flushQueues());
+    vm0.invoke(() -> InterestListDUnitTest.flushQueues());
 
-      vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
-    }
+    vm1.invoke(() -> InterestListDUnitTest.validateEntriesAgain( "vm1" ));
+  }
 
-    /**
-     * two servers one client
-     * create Entries in all the vms
-     * register interest in various ways and ensure that registration listeners
-     * are properly invoked
-     * @throws Exception 
-     */
-    public void testInterestRegistrationListeners() throws Exception {
-      int port2;
+  /**
+   * two servers one client
+   * create Entries in all the vms
+   * register interest in various ways and ensure that registration listeners
+   * are properly invoked
+   */
+  @Test
+  public void testInterestRegistrationListeners() throws Exception {
+    int port2;
 
-      createCache();
-      server = addCacheServer();
-      port2 = server.getPort();
+    createCache();
+    server = addCacheServer();
+    port2 = server.getPort();
 
-      addRegisterInterestListener();
-      vm0.invoke(() -> InterestListDUnitTest.addRegisterInterestListener());
+    addRegisterInterestListener();
+    vm0.invoke(() -> InterestListDUnitTest.addRegisterInterestListener());
 
-      // servers are set up, now do the clients
-      DistributedMember c1 = (DistributedMember)vm1
-      .invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
-      DistributedMember c2 = (DistributedMember)vm2
-      .invoke(() -> InterestListDUnitTest.createClientCache(
-        NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
+    // servers are set up, now do the clients
+    DistributedMember c1 = (DistributedMember)vm1
+    .invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
+    DistributedMember c2 = (DistributedMember)vm2
+    .invoke(() -> InterestListDUnitTest.createClientCache(
+      NetworkUtils.getServerHostName(vm0.getHost()), PORT1, port2));
 
-      vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
-      vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm1.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
+    vm2.invoke(() -> InterestListDUnitTest.createEntriesK1andK2());
 
-      // interest registration from clients should cause listeners to be invoked
-      // in both servers
-      LogWriterUtils.getLogWriter().info("test phase 1");
-      vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
+    // interest registration from clients should cause listeners to be invoked
+    // in both servers
+    LogWriterUtils.getLogWriter().info("test phase 1");
+    vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.registerKey( key2 ));
 
-      Integer zero = new Integer(0);
-      Integer two = new Integer(2);
+    Integer zero = new Integer(0);
+    Integer two = new Integer(2);
 
-      interestListener.verifyCountsAndClear(2, 0);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
+    interestListener.verifyCountsAndClear(2, 0);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
 
-      // unregistration from clients should invoke listeners on both servers
-      LogWriterUtils.getLogWriter().info("test phase 2");
-      vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
-      vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
+    // unregistration from clients should invoke listeners on both servers
+    LogWriterUtils.getLogWriter().info("test phase 2");
+    vm1.invoke(() -> InterestListDUnitTest.unregisterKey( key1 ));
+    vm2.invoke(() -> InterestListDUnitTest.unregisterKey( key2 ));
 
-      interestListener.verifyCountsAndClear(0, 2);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
+    interestListener.verifyCountsAndClear(0, 2);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
 
-      // now the primary server for eache client will register and unregister
-      LogWriterUtils.getLogWriter().info("test phase 3");
-      registerKeyForClient(c1, key1);
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
-      registerKeyForClient(c2, key2);
-      vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
+    // now the primary server for eache client will register and unregister
+    LogWriterUtils.getLogWriter().info("test phase 3");
+    registerKeyForClient(c1, key1);
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c1, key1 ));
+    registerKeyForClient(c2, key2);
+    vm0.invoke(() -> InterestListDUnitTest.registerKeyForClient( c2, key2 ));
 
-      interestListener.verifyCountsAndClear(2, 0);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
+    interestListener.verifyCountsAndClear(2, 0);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( two, zero ));
 
-      LogWriterUtils.getLogWriter().info("test phase 4");
-      unregisterKeyForClient(c1, key1);
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
-      unregisterKeyForClient(c2, key2);
-      vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
+    LogWriterUtils.getLogWriter().info("test phase 4");
+    unregisterKeyForClient(c1, key1);
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c1, key1 ));
+    unregisterKeyForClient(c2, key2);
+    vm0.invoke(() -> InterestListDUnitTest.unregisterKeyForClient( c2, key2 ));
 
-      interestListener.verifyCountsAndClear(0, 2);
-      vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
-    }
+    interestListener.verifyCountsAndClear(0, 2);
+    vm0.invoke(() -> InterestListDUnitTest.verifyCountsAndClear( zero, two ));
+  }
 
   /**
    * This tests whether an exception is thrown in register/unregister when no
    * server is available.
    */
-  public void testNoAvailableServer() {
-
+  @Test
+  public void testNoAvailableServer() throws Exception {
     // Register interest in key1.
     vm1.invoke(() -> InterestListDUnitTest.createClientCache( NetworkUtils.getServerHostName(vm0.getHost()), new Integer(PORT1) ));
     vm1.invoke(() -> InterestListDUnitTest.registerKey( key1 ));
@@ -437,11 +469,13 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.registerKeyEx( key2 ));
   }
 
+  @Test
   public void testRegisterInterestOnReplicatedRegionWithCacheLoader() {
     runRegisterInterestWithCacheLoaderTest(true);
   }
 
-  public void testRegisterInterestOnPartitionedRegionWithCacheLoader() {
+  @Test
+  public void testRegisterInterestOnPartitionedRegionWithCacheLoader() throws Exception {
     runRegisterInterestWithCacheLoaderTest(false);
   }
 
@@ -482,26 +516,23 @@ public class InterestListDUnitTest extends DistributedTestCase
     vm1.invoke(() -> InterestListDUnitTest.confirmNoCacheListenerInvalidates());
   }
   
-  private  void createCache(Properties props) throws Exception
-  {
+  private  void createCache(Properties props) throws Exception {
     DistributedSystem ds = getSystem(props);
     cache = CacheFactory.create(ds);
     assertNotNull(cache);
   }
 
-  public static DistributedMember createClientCache(String host, int port) throws Exception {
+  private static DistributedMember createClientCache(String host, int port) throws Exception {
     return createClientCache(host, port, 0);
   }
 
-  public static DistributedMember createClientCache(String host,
-      int port, int port2) throws Exception
-  {
+  private static DistributedMember createClientCache(String host, int port, int port2) throws Exception {
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
     props.setProperty(DELTA_PROPAGATION, "false");
 
-    new InterestListDUnitTest("temp").createCache(props);
+    new InterestListDUnitTest().createCache(props);
     PoolFactory pfactory = PoolManager.createFactory()
       .addServer(host, port)
       .setThreadLocalConnections(true)
@@ -533,7 +564,7 @@ public class InterestListDUnitTest extends DistributedTestCase
   private static void createCache(boolean addReplicatedRegion) throws Exception {
     Properties props = new Properties();
     props.setProperty(DELTA_PROPAGATION, "false");
-    new InterestListDUnitTest("temp").createCache(props);
+    new InterestListDUnitTest().createCache(props);
     if (addReplicatedRegion) {
       addReplicatedRegion();
     } else {
@@ -565,25 +596,27 @@ public class InterestListDUnitTest extends DistributedTestCase
   // this method is for use in vm0 where the CacheServer used by
   // most of these tests resides.  This server is held in the
   // static variable 'server1'
-  public static Integer createServerCache() throws Exception {
+  private static Integer createServerCache() throws Exception {
     return createServerCache(true);
   }
 
-  public static Integer createServerCache(boolean addReplicatedRegion) throws Exception {
+  private static Integer createServerCache(boolean addReplicatedRegion) throws Exception {
     createCache(addReplicatedRegion);
     server = addCacheServer();
     return new Integer(server.getPort());
   }
 
   /** wait for queues to drain in the server */
-  public static void flushQueues() throws Exception {
+  private static void flushQueues() throws Exception {
     CacheServerImpl impl = (CacheServerImpl)server;
     for (CacheClientProxy proxy: (Set<CacheClientProxy>)impl.getAllClientSessions()) {
       final CacheClientProxy fproxy = proxy;
       WaitCriterion ev = new WaitCriterion() {
+        @Override
         public boolean done() {
           return fproxy.getHARegionQueue().size() == 0;
         }
+        @Override
         public String description() {
           return "waiting for queues to drain for " + fproxy.getProxyID();
         }
@@ -592,7 +625,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void addRegisterInterestListener() {
+  private static void addRegisterInterestListener() {
     interestListener = new InterestListener();
     List<CacheServer> servers = cache.getCacheServers();
     for (CacheServer s: servers) {
@@ -627,9 +660,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     final EventCountingCacheListener fCacheListener = (EventCountingCacheListener) region.getAttributes().getCacheListener();
   
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         return fCacheListener.hasReceivedAllCreateEvents();
       }
+      @Override
       public String description() {
         return "waiting for " + fCacheListener.getExpectedCreates() + " create events";
       }
@@ -653,12 +688,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(0/*expected*/, cacheListener.getInvalidates()/*actual*/);
   }
 
-  public static void verifyCountsAndClear(int count1, int count2) {
+  private static void verifyCountsAndClear(int count1, int count2) {
     interestListener.verifyCountsAndClear(count1, count2);
   }
 
-  public static void createEntriesK1andK2()
-  {
+  private static void createEntriesK1andK2() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -678,14 +712,12 @@ public class InterestListDUnitTest extends DistributedTestCase
   }
 
   private static void registerKeyOnly(Object key) {
-
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     r.registerInterest(key);
   }
 
-  public static void registerKey(Object key)
-  {
+  private static void registerKey(Object key) {
     try {
       registerKeyOnly(key);
     }
@@ -700,7 +732,7 @@ public class InterestListDUnitTest extends DistributedTestCase
    * @param clientId the DM of the client
    * @param key the key that the client is interested in
    */
-  public static void registerKeyForClient(DistributedMember clientId, Object key) {
+  private static void registerKeyForClient(DistributedMember clientId, Object key) {
     try {
       ClientSession cs = server.getClientSession(clientId);
       if (cs.isPrimary()) {
@@ -712,8 +744,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeyEx(Object key) {
-
+  private static void registerKeyEx(Object key) {
     try {
       registerKeyOnly(key);
       fail("Expected an exception during register interest with no available servers.");
@@ -724,8 +755,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerALL_KEYS()
-  {
+  private static void registerALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -736,8 +766,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void put_ALL_KEYS()
-  {
+  private static void put_ALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -752,8 +781,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validate_ALL_KEYS()
-  {
+  private static void validate_ALL_KEYS() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -765,8 +793,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeys()
-  {
+  private static void registerKeys() {
     List list = new ArrayList();
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -780,8 +807,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void registerKeysAgain()
-  {
+  private static void registerKeysAgain() {
     List list = new ArrayList();
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -796,14 +822,12 @@ public class InterestListDUnitTest extends DistributedTestCase
   }
 
   private static void unregisterKeyOnly(Object key) {
-
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     r.unregisterInterest(key);
   }
 
-  public static void unregisterKey(Object key)
-  {
+  private static void unregisterKey(Object key) {
     try {
       unregisterKeyOnly(key);
     }
@@ -817,8 +841,7 @@ public class InterestListDUnitTest extends DistributedTestCase
    * @param clientId the client's ID
    * @param key the key it's no longer interest in
    */
-  public static void unregisterKeyForClient(DistributedMember clientId, Object key)
-  {
+  private static void unregisterKeyForClient(DistributedMember clientId, Object key) {
     try {
       ClientSession cs = server.getClientSession(clientId);
       if (cs.isPrimary()) {
@@ -830,12 +853,11 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void unregisterKeyEx(Object key) {
+  private static void unregisterKeyEx(Object key) {
     unregisterKeyOnly(key);
   }
 
-  public static void validateRegionEntriesFromInterestListInVm1()
-  {
+  private static void validateRegionEntriesFromInterestListInVm1() {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     Region.Entry k1, k2;
@@ -847,8 +869,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(k2.getValue(), "server2");
   }
 
-  public static void validateRegionEntriesFromInterestListInVm2()
-  {
+  private static void validateRegionEntriesFromInterestListInVm2() {
     Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
     assertNotNull(r);
     assertEquals(r.getEntry("k3").getValue(), "server3");
@@ -856,7 +877,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     assertEquals(r.getEntry("k5").getValue(), "server5");
   }
 
-  public static void putSingleEntry(Object key, String value) {
+  private static void putSingleEntry(Object key, String value) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -869,8 +890,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void put(String vm)
-  {
+  private static void put(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -895,8 +915,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void multiple_put()
-  {
+  private static void multiple_put() {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -912,8 +931,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void putAgain(String vm)
-  {
+  private static void putAgain(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -938,9 +956,9 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validateEntriesK1andK2(final String vm)
-  {
+  private static void validateEntriesK1andK2(final String vm) {
     WaitCriterion ev = new WaitCriterion() {
+      @Override
       public boolean done() {
         try {
           Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
@@ -959,10 +977,11 @@ public class InterestListDUnitTest extends DistributedTestCase
           }
           return true;
         }
-        catch (AssertionFailedError ex) {
+        catch (AssertionError ex) {
           return false;
         }
       }
+      @Override
       public String description() {
         return "waiting for client to apply events from server";
       }
@@ -970,7 +989,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 5 * 10 * 1000, 200, true);
   }
 
-  public static void validateSingleEntry(Object key, String value) {
+  private static void validateSingleEntry(Object key, String value) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertEquals(value, r.getEntry(key).getValue());
@@ -980,8 +999,7 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  public static void validateEntriesAgain(String vm)
-  {
+  private static void validateEntriesAgain(String vm) {
     try {
       Region r = cache.getRegion(Region.SEPARATOR + REGION_NAME);
       assertNotNull(r);
@@ -1002,40 +1020,25 @@ public class InterestListDUnitTest extends DistributedTestCase
     }
   }
 
-  @Override
-  public final void preTearDown() throws Exception {
-    // close the clients first
-    vm1.invoke(() -> InterestListDUnitTest.closeCache());
-    vm2.invoke(() -> InterestListDUnitTest.closeCache());
-    // then close the servers
-    vm0.invoke(() -> InterestListDUnitTest.closeCache());
-    cache = null;
-    Invoke.invokeInEveryVM(new SerializableRunnable() { public void run() { cache = null; } });
-  }
-
-  public static void closeCache()
-  {
+  private static void closeCache() {
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
     }
   }
 
-  static class InterestListener implements InterestRegistrationListener {
+  private static class InterestListener implements InterestRegistrationListener {
+
     private int registrationCount;
     private int unregistrationCount;
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.InterestRegistrationListener#afterRegisterInterest(com.gemstone.gemfire.cache.InterestRegistrationEvent)
-     */
+    @Override
     public void afterRegisterInterest(InterestRegistrationEvent event) {
       LogWriterUtils.getLogWriter().info("InterestListener.afterRegisterInterest invoked with this event: " + event);
       registrationCount++;
     }
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.InterestRegistrationListener#afterUnregisterInterest(com.gemstone.gemfire.cache.InterestRegistrationEvent)
-     */
+    @Override
     public void afterUnregisterInterest(InterestRegistrationEvent event) {
       LogWriterUtils.getLogWriter().info("InterestListener.afterUnregisterInterest invoked with this event: " + event);
       unregistrationCount++;
@@ -1054,9 +1057,7 @@ public class InterestListDUnitTest extends DistributedTestCase
       unregistrationCount = 0;
     }
 
-    /* (non-Javadoc)
-     * @see com.gemstone.gemfire.cache.CacheCallback#close()
-     */
+    @Override
     public void close() {
     }
 
@@ -1067,9 +1068,7 @@ public class InterestListDUnitTest extends DistributedTestCase
   private static class EventCountingCacheListener extends CacheListenerAdapter {
 
     private AtomicInteger creates = new AtomicInteger();
-
     private AtomicInteger updates = new AtomicInteger();
-
     private AtomicInteger invalidates = new AtomicInteger();
 
     private int expectedCreates;
@@ -1082,15 +1081,18 @@ public class InterestListDUnitTest extends DistributedTestCase
       return this.expectedCreates;
     }
 
+    @Override
     public void afterCreate(EntryEvent event) {
       incrementCreates();
     }
 
+    @Override
     public void afterUpdate(EntryEvent event) {
       incrementUpdates();
       event.getRegion().getCache().getLogger().warning("Received update event " + getUpdates() + " for " + event.getKey());
     }
 
+    @Override
     public void afterInvalidate(EntryEvent event) {
       incrementInvalidates();
       event.getRegion().getCache().getLogger().warning("Received invalidate event " + getInvalidates() + " for " + event.getKey());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
index 6213e85..f5c4bc0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointDUnitTest.java
@@ -16,7 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
@@ -27,22 +46,18 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
-import com.gemstone.gemfire.test.dunit.*;
-import junit.framework.Assert;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
-/**
- *
- *
- */
-public class InterestListEndpointDUnitTest extends DistributedTestCase
-{
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.Invoke;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
+@Category(DistributedTest.class)
+public class InterestListEndpointDUnitTest extends JUnit4DistributedTestCase {
 
   VM server1 = null;
 
@@ -67,11 +82,6 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   static InterestListEndpointDUnitTest impl;
 
-  /** constructor */
-  public InterestListEndpointDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -98,7 +108,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   /** subclass support */
   public static void createImpl() {
-    impl = new InterestListEndpointDUnitTest("temp");
+    impl = new InterestListEndpointDUnitTest();
   }
 
   private void createCache(Properties props) throws Exception
@@ -112,6 +122,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
    * tests wheteher upadets are sent to clients if put on server directly
    *
    */
+  @Test
   public void testDirectPutOnServer()
   {
     client1.invoke(() -> impl.createEntriesK1andK2());
@@ -127,6 +138,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
   * put on non interest list ep and verify updates
   *
   */
+  @Test
   public void testInterestListEndpoint()
   {
     client1.invoke(() -> createEntriesK1andK2());
@@ -140,6 +152,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
     client1.invoke(() -> verifyPut());
   }
 
+  @Test
   public void testInterestListEndpointAfterFailover() throws Exception
   {
     final long maxWaitTime = 20000;
@@ -212,7 +225,8 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
   }
 
 
- public void testUpdaterThreadIsAliveForFailedEndPoint(){
+  @Test
+  public void testUpdaterThreadIsAliveForFailedEndPoint(){
       client1.invoke(() -> acquirePoolConnection());
       client1.invoke(() -> processException());
       client1.invoke(() -> verifyUpdaterThreadIsAlive());
@@ -246,8 +260,8 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
  public static void verifyUpdaterThreadIsAlive() throws InterruptedException
  {
    QueueConnectionImpl conn2 = (QueueConnectionImpl) pool.getPrimaryConnection();
-   Assert.assertNotSame(conn1, conn2);
-   Assert.assertFalse(conn1.getServer().equals(conn2.getServer()));
+   assertNotSame(conn1, conn2);
+   assertFalse(conn1.getServer().equals(conn2.getServer()));
    assertNull(((QueueConnectionImpl)conn1).getUpdater());
    assertTrue((conn2).getUpdater().isAlive());
  }
@@ -307,7 +321,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    new InterestListEndpointDUnitTest("temp").createCache(props);
+    new InterestListEndpointDUnitTest().createCache(props);
     Pool p;
     try {
       p = PoolManager.createFactory()
@@ -346,7 +360,7 @@ public class InterestListEndpointDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache(Integer maxThreads) throws Exception
   {
-    new InterestListEndpointDUnitTest("temp").createCache(new Properties());
+    new InterestListEndpointDUnitTest().createCache(new Properties());
     RegionAttributes attrs = impl.createServerCacheAttributes();
     cache.createRegion(REGION_NAME, attrs);
     CacheServer server1 = cache.addCacheServer();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
index e08202d..30f91a1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointPRDUnitTest.java
@@ -16,19 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 import com.gemstone.gemfire.cache.*;
 
 /**
  * subclass of InterestListEndpointDUnitTest to exercise partitioned regions
  *
  */
+@Category(DistributedTest.class)
 public class InterestListEndpointPRDUnitTest extends InterestListEndpointDUnitTest {
 
-  public InterestListEndpointPRDUnitTest(String name) {
-    super(name);
+  public InterestListEndpointPRDUnitTest() {
+    super();
   }
   public static void createImpl() {
-    impl = new InterestListEndpointPRDUnitTest("temp");
+    impl = new InterestListEndpointPRDUnitTest();
   }
   
   protected RegionAttributes createServerCacheAttributes()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
index 2a5d32e..5bfa0c7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListEndpointSelectorDUnitTest.java
@@ -16,16 +16,26 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import org.junit.experimental.categories.Category;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
+
 /**
  * Just like InterestListEndpointDUnitTest but uses thread pool (i.e. selector)
  * in bridge servers
  *
  */
+@Category(DistributedTest.class)
 public class InterestListEndpointSelectorDUnitTest
   extends InterestListEndpointDUnitTest
 {
-  public InterestListEndpointSelectorDUnitTest(String name) {
-    super(name);
+  public InterestListEndpointSelectorDUnitTest() {
+    super();
   }
 
   protected int getMaxThreads() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
index 66527d0..2a27474 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java
@@ -16,23 +16,28 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-
+import static org.junit.Assert.*;
 
 import java.util.Iterator;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.Pool;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.cache.client.*;
-import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.PoolFactoryImpl;
 import com.gemstone.gemfire.test.dunit.Assert;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.NetworkUtils;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
-import com.gemstone.gemfire.cache.client.internal.PoolImpl;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Test Scenario :
@@ -47,11 +52,12 @@ import com.gemstone.gemfire.cache.client.internal.PoolImpl;
  * c2 : put (k1 -> vm2-key-1) and (k6 -> vm2-key-6)
  * c1 :  validate (r.getEntry("key-1").getValue() == "vm2-key-1")
  *                (r.getEntry("key-6").getValue() == "key-6") // as it is not registered *
- *
- *
  */
-public class InterestListFailoverDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestListFailoverDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final String REGION_NAME = InterestListFailoverDUnitTest.class.getSimpleName() + "_region";
+
   VM vm0 = null;
 
   VM vm1 = null;
@@ -63,13 +69,6 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
   private int PORT1;
   private int PORT2;
 
-  private static final String REGION_NAME = "InterestListFailoverDUnitTest_region";
-
-  /** constructor */
-  public InterestListFailoverDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -113,11 +112,13 @@ public class InterestListFailoverDUnitTest extends DistributedTestCase
  *
  */
 
+  @Test
   public void testInterestListRecoveryHA()
   {
     doTestInterestListRecovery(-1);
   }
 
+  @Test
   public void testInterestListRecoveryNonHA()
   {
     doTestInterestListRecovery(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
index 0a44d60..280ab66 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
@@ -16,9 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.io.EOFException;
+import java.net.SocketException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
@@ -27,20 +48,16 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.io.EOFException;
-import java.net.SocketException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
- *
  * Test Scenario :
  *
  * one client(c1) two servers(s1,s2)
@@ -52,10 +69,12 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
  * see interest list on s1 contains only s4, s5
  * s2 ----> unavaliable // fail over should to s1 with intrest list s4,s5
  * see only k4 and k5 are registerd on s1
- *
  */
-public class InterestListRecoveryDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestListRecoveryDUnitTest extends JUnit4DistributedTestCase {
+
+  private static final String REGION_NAME = InterestListRecoveryDUnitTest.class.getSimpleName() + "_region";
+
   private static Cache cache = null;
 
   VM server1 = null;
@@ -67,14 +86,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
   private static int PORT1;
   private static int PORT2;
 
-
-  private static final String REGION_NAME = "InterestListRecoveryDUnitTest_region";
-
-  /** constructor */
-  public InterestListRecoveryDUnitTest(String name) {
-    super(name);
-  }
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -92,9 +103,9 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     createClientCache(NetworkUtils.getServerHostName(host), new Integer(PORT1), new Integer(PORT2));
   }
 
-  // this test fails because of bug# 35352 , hence commented the bug is Deferred to: Danube
-  public void XtestKeyInterestRecoveryWhileServerFailover() throws Exception
-  {
+  @Ignore("TODO: test is disabled because of #35352: proxy.markServerUnavailable() is not causing interestListEndpoint to change")
+  @Test
+  public void testKeyInterestRecoveryWhileServerFailover() throws Exception {
     createEntries();
     server1.invoke(() -> InterestListRecoveryDUnitTest.createEntries());
     registerK1toK5();
@@ -111,6 +122,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   }
 
+  @Test
   public void testKeyInterestRecoveryWhileProcessException() throws Exception {
     VM serverFirstRegistered = null;
     VM serverSecondRegistered = null;
@@ -188,8 +200,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   public static void createClientCache(String host, Integer port1, Integer port2 ) throws Exception
   {
-    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest(
-        "temp");
+    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
@@ -218,8 +229,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
 
   public static Integer createServerCache() throws Exception
   {
-    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest(
-        "temp");
+    InterestListRecoveryDUnitTest test = new InterestListRecoveryDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -234,9 +244,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     return new Integer(server1.getPort());
   }
 
-
-
-
   public static void createEntries()
   {
     try {
@@ -290,6 +297,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
       Assert.fail("while setting server unavailable  "+ server, ex);
     }
   }
+
   public static void setServerAvailable(String server)
   {
     try {
@@ -316,8 +324,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     }
   }
 
-
-
   public static void put(String key)
   {
     try {
@@ -329,7 +335,6 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     }
   }
 
-
   public static void verifyRegionToProxyMapForFullRegistrationRetry() {
     WaitCriterion ev = new WaitCriterion() {
       public boolean done() {
@@ -355,21 +360,19 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
   
-   public static void verifyRegionToProxyMapForFullRegistration()
-   {
-     Iterator iter = getCacheClientProxies().iterator();
-     if(iter.hasNext()){
-       Set keys = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-       assertNotNull(keys);
-
-       assertTrue(keys.contains("key-1"));
-       assertTrue(keys.contains("key-2"));
-       assertTrue(keys.contains("key-3"));
-       assertTrue(keys.contains("key-4"));
-       assertTrue(keys.contains("key-5"));
-     }
-   }
-
+  public static void verifyRegionToProxyMapForFullRegistration() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if(iter.hasNext()){
+      Set keys = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      assertNotNull(keys);
+
+      assertTrue(keys.contains("key-1"));
+      assertTrue(keys.contains("key-2"));
+      assertTrue(keys.contains("key-3"));
+      assertTrue(keys.contains("key-4"));
+      assertTrue(keys.contains("key-5"));
+    }
+  }
 
   public static void verifyRegisterK4toK5Retry() {
     WaitCriterion ev = new WaitCriterion() {
@@ -397,19 +400,19 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
 
-   public static void verifyRegisterK4toK5() {
-     Iterator iter = getCacheClientProxies().iterator();
-     if (iter.hasNext()) {
-       Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-       assertNotNull(keysMap);
-
-       assertFalse(keysMap.contains("key-1"));
-       assertFalse(keysMap.contains("key-2"));
-       assertFalse(keysMap.contains("key-3"));
-       assertTrue(keysMap.contains("key-4"));
-       assertTrue(keysMap.contains("key-5"));
-     }
-   }
+  public static void verifyRegisterK4toK5() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if (iter.hasNext()) {
+      Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      assertNotNull(keysMap);
+
+      assertFalse(keysMap.contains("key-1"));
+      assertFalse(keysMap.contains("key-2"));
+      assertFalse(keysMap.contains("key-3"));
+      assertTrue(keysMap.contains("key-4"));
+      assertTrue(keysMap.contains("key-5"));
+    }
+  }
 
   public static void verifyRegionToProxyMapForNoRegistrationRetry() {
     WaitCriterion ev = new WaitCriterion() {
@@ -436,41 +439,40 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
     Wait.waitForCriterion(ev, 20 * 1000, 200, true);
   }
 
- public static void verifyRegionToProxyMapForNoRegistration()
- {
-   Iterator iter = getCacheClientProxies().iterator();
-   if (iter.hasNext()) {
-     Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
-     if (keysMap != null) { // its ok not to have an empty map, just means there is no registration
-       assertFalse(keysMap.contains("key-1"));
-       assertFalse(keysMap.contains("key-2"));
-       assertFalse(keysMap.contains("key-3"));
-       assertFalse(keysMap.contains("key-4"));
-       assertFalse(keysMap.contains("key-5"));
-     }
-   }
- }
-
- public static Set getCacheClientProxies() {
-   Cache c = CacheFactory.getAnyInstance();
-   assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
-   CacheServerImpl bs = (CacheServerImpl)c.getCacheServers().iterator()
-   .next();
-   assertNotNull(bs);
-   assertNotNull(bs.getAcceptor());
-   assertNotNull(bs.getAcceptor().getCacheClientNotifier());
-   return new HashSet(bs.getAcceptor().getCacheClientNotifier().getClientProxies());
- }
-
- public static Set getKeysOfInterestMap(CacheClientProxy proxy, String regionName) {
-   //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]);
-   //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]._keysOfInterest);
-   return proxy.cils[RegisterInterestTracker.interestListIndex]
-     .getProfile(regionName).getKeysOfInterestFor(proxy.getProxyID());
- }
-
- @Override
- public final void preTearDown() throws Exception {
+  public static void verifyRegionToProxyMapForNoRegistration() {
+    Iterator iter = getCacheClientProxies().iterator();
+    if (iter.hasNext()) {
+      Set keysMap = getKeysOfInterestMap((CacheClientProxy)iter.next(), "/" + REGION_NAME);
+      if (keysMap != null) { // its ok not to have an empty map, just means there is no registration
+        assertFalse(keysMap.contains("key-1"));
+        assertFalse(keysMap.contains("key-2"));
+        assertFalse(keysMap.contains("key-3"));
+        assertFalse(keysMap.contains("key-4"));
+        assertFalse(keysMap.contains("key-5"));
+      }
+    }
+  }
+
+  public static Set getCacheClientProxies() {
+    Cache c = CacheFactory.getAnyInstance();
+    assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
+    CacheServerImpl bs = (CacheServerImpl)c.getCacheServers().iterator()
+    .next();
+    assertNotNull(bs);
+    assertNotNull(bs.getAcceptor());
+    assertNotNull(bs.getAcceptor().getCacheClientNotifier());
+    return new HashSet(bs.getAcceptor().getCacheClientNotifier().getClientProxies());
+  }
+
+  public static Set getKeysOfInterestMap(CacheClientProxy proxy, String regionName) {
+    //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]);
+    //assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]._keysOfInterest);
+    return proxy.cils[RegisterInterestTracker.interestListIndex]
+      .getProfile(regionName).getKeysOfInterestFor(proxy.getProxyID());
+  }
+
+  @Override
+  public final void preTearDown() throws Exception {
     // close the clients first
     server2.invoke(() -> InterestListRecoveryDUnitTest.closeCache());
     closeCache();
@@ -485,8 +487,7 @@ public class InterestListRecoveryDUnitTest extends DistributedTestCase
       cache.getDistributedSystem().disconnect();
     }
   }
-  
-  
+
   public static void verifyDeadAndLiveServers(final int expectedDeadServers, 
       final int expectedLiveServers)
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
index a2536c1..e16eb9c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java
@@ -16,15 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.ClientCacheFactory;
-import com.gemstone.gemfire.cache.client.ClientRegionFactory;
-import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.server.CacheServer;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.internal.AvailablePortHelper;
-import com.gemstone.gemfire.test.dunit.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.net.InetAddress;
@@ -32,13 +25,38 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.ClientSession;
+import com.gemstone.gemfire.cache.InterestRegistrationEvent;
+import com.gemstone.gemfire.cache.InterestRegistrationListener;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientCacheFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.server.CacheServer;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.internal.AvailablePortHelper;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.WaitCriterion;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * Written to test fix for Bug #47132
- *
  */
-public class InterestRegrListenerDUnitTest extends DistributedTestCase {
+@Category(DistributedTest.class)
+public class InterestRegrListenerDUnitTest extends JUnit4DistributedTestCase {
   
   private Cache cache;
   private DistributedSystem ds;
@@ -52,14 +70,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
   private static final String REGISTER_INTEREST = "RegisterInterest";
   private static final int DURABLE_CLIENT_TIMEOUT_TEST=20;
   
-  private static InterestRegrListenerDUnitTest instance = new InterestRegrListenerDUnitTest("InterestRegrListenerDUnitTest");
-
-
-  public InterestRegrListenerDUnitTest(String name) {
-    super(name);    
-  }
-  
-  private static final long serialVersionUID = 1L;
+  private static InterestRegrListenerDUnitTest instance = new InterestRegrListenerDUnitTest();
 
   @Override
   public final void preSetUp() throws Exception {
@@ -84,8 +95,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     hostName = InetAddress.getLocalHost().getHostAddress();
     listnerMap.clear();
   }
-  
-  
+
   public int getCacheServerPort(){
     return cacheServerPort;
   }
@@ -239,6 +249,7 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     instance.doClientRegionRegisterInterest(isDurable);
   }
   
+  @Test
   public void testDurableClientExit_ClientExpressedInterest() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -302,8 +313,8 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     assertEquals(3, unregisterCount);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());    
   }
-  
-  
+
+  @Test
   public void testDurableClientExit_ServerExpressedInterest() throws Exception {
     final Host host = Host.getHost(0);
     VM serverVM = host.getVM(0);
@@ -363,11 +374,9 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     assertEquals(3, registerCount);
     assertEquals(3, unregisterCount);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());
-    
   }
-  
-  
-  
+
+  @Test
   public void testDurableClientExit_ServerExpressedInterest_NonDurableInterest() throws Exception {
     final Host host = Host.getHost(0);
     final VM serverVM = host.getVM(0);
@@ -444,7 +453,6 @@ public class InterestRegrListenerDUnitTest extends DistributedTestCase {
     Thread.sleep((DURABLE_CLIENT_TIMEOUT_TEST+5)*1000);
     serverVM.invoke(() -> InterestRegrListenerDUnitTest.closeCacheTask());
   }
-  
 
   private int getMapValueForKey(Map<String, Integer> map, String key) {
     if (map.containsKey(key))

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
index eaa8433..6f23ff8 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestResultPolicyDUnitTest.java
@@ -16,30 +16,46 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.ServerConnectivityException;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * DUnit Test for use-cases of various {@link InterestResultPolicy} types.
- *
- *
  */
-public class InterestResultPolicyDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class InterestResultPolicyDUnitTest extends JUnit4DistributedTestCase {
+
   /** test VM */
   VM vm0, vm1 = null;
 
@@ -49,23 +65,13 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   /** the cache instance for the test */
   private static Cache cache = null;
   
-  private int PORT   ; 
+  private int PORT;
 
-  private static final String REGION_NAME = "InterestResultPolicyDUnitTest_region" ;
+  private static final String REGION_NAME = InterestResultPolicyDUnitTest.class.getSimpleName() + "_region" ;
 
   private IgnoredException expectedEx;
 
   /**
-   * Creates a test instance with the given name
-   *
-   * @param name -
-   *          name of test instance
-   */
-  public InterestResultPolicyDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Creates the server cache and populates it with some entries
    */
   @Override
@@ -108,6 +114,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that no entries are created
    * in the client cache<br>
    */
+  @Test
   public void testPolicyNone()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -131,6 +138,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that entries are created in
    * the client cache with value null<br>
    */
+  @Test
   public void testPolicyKeys()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -154,6 +162,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * 3)At the end of registerInterest call, verify that all entries are created
    * in the client cache with values<br>
    */
+  @Test
   public void testPolicyKeysValues()
   {
     LogWriter logger = getSystem().getLogWriter();
@@ -179,6 +188,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    * in the keylist which are not on the server should not be created on the
    * client as a result of registerInterest call)<br>
    */
+  @Test
   public void testBug35358()
   {
     Host host = Host.getHost(0);
@@ -239,8 +249,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
    */
   public static Integer createServerCache() throws Exception
   {
-    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest(
-        "temp");
+    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -279,8 +288,7 @@ public class InterestResultPolicyDUnitTest extends DistributedTestCase
   public static void createClientCache(String host, Integer port) throws Exception
   {
     int PORT = port.intValue() ;
-    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest(
-        "temp");
+    InterestResultPolicyDUnitTest test = new InterestResultPolicyDUnitTest();
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
index 0f78c66..7f16642 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/NewRegionAttributesDUnitTest.java
@@ -16,10 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
@@ -29,18 +34,18 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
 import com.gemstone.gemfire.test.dunit.Wait;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
 /**
  * This tests that basic entry operations work properly when regions are
  * configured with newly added RegionAttributes in a P2P environment.
- * 
  */
-public class NewRegionAttributesDUnitTest extends DistributedTestCase
-{
+@Category(DistributedTest.class)
+public class NewRegionAttributesDUnitTest extends JUnit4DistributedTestCase {
 
   /** test VM */
   VM vm0, vm1 = null;
@@ -54,16 +59,6 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
   private static final String REGION_NAME = "NewRegionAttributesDUnitTest_region" ;
 
   /**
-   * Creates a test instance with the given name
-   * 
-   * @param name -
-   *          name of test instance
-   */
-  public NewRegionAttributesDUnitTest(String name) {
-    super(name);
-  }
-
-  /**
    * Creates the server cache on test-VMs
    * 
    * @throws Exception
@@ -124,7 +119,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
   public static void createServerCache(Boolean enableWan, Boolean setPublisher,
       Boolean enableConflation, Boolean enableAsyncConflation) throws Exception
   {
-    NewRegionAttributesDUnitTest test = new NewRegionAttributesDUnitTest("temp");
+    NewRegionAttributesDUnitTest test = new NewRegionAttributesDUnitTest();
     cache = test.createCache(new Properties());
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
@@ -182,6 +177,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
    * @see AttributesFactory#setEnableConflation(boolean)
    * @see AttributesFactory#setEnableAsyncConflation(boolean)
    */
+  @Test
   public void testEntryOperationsWithNewAttributesEnabled()
   {
     vm0.invoke(() -> NewRegionAttributesDUnitTest.checkAttributes());
@@ -202,6 +198,7 @@ public class NewRegionAttributesDUnitTest extends DistributedTestCase
    * test-region (which does not have any bridge-client or bridge-server) and
    * verifies that <code>UnsupportedOperationException</code> occurs as expected
    */
+  @Test
   public void testRegisterInterestUseCases()
   {
     vm1.invoke(() -> NewRegionAttributesDUnitTest.registerInterest());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
index 0805e2a..10f707d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ObjectPartListJUnitTest.java
@@ -39,7 +39,7 @@ public class ObjectPartListJUnitTest {
     list.addObjectPart("key", "value2", true, null);
     byte[] serializedObjectBytes = BlobHelper.serializeToBlob("value3");
     list.addObjectPart("key", serializedObjectBytes, true, null);
-    list.addExceptionPart("key", new TestException("hello"));
+    list.addExceptionPart("key", new AssertionError("hello"));
     list.addObjectPartForAbsentKey("key", null);
     
     //Create a clone of the this.
@@ -65,7 +65,7 @@ public class ObjectPartListJUnitTest {
     assertEquals("value1", new String((byte[]) values.get(0)));
     assertEquals("value2", values.get(1));
     assertEquals("value3", values.get(2));
-    assertEquals(new TestException("hello"), values.get(3));
+    assertEquals(new AssertionError("hello"), values.get(3));
     assertNull(values.get(4));
   }
 
@@ -77,7 +77,7 @@ public class ObjectPartListJUnitTest {
     list.addObjectPart("key", "value2", true, null);
     byte[] serializedObjectBytes = BlobHelper.serializeToBlob("value3");
     list.addObjectPart("key", serializedObjectBytes, true, null);
-    list.addExceptionPart("key", new TestException("hello"));
+    list.addExceptionPart("key", new AssertionError("hello"));
     list.addObjectPartForAbsentKey("key", null);
     
     //Create a clone of the this list.
@@ -100,22 +100,22 @@ public class ObjectPartListJUnitTest {
     assertEquals("value1", new String((byte[]) values.get(0)));
     assertEquals("value2", BlobHelper.deserializeBlob((byte[])values.get(1)));
     assertEquals("value3", BlobHelper.deserializeBlob((byte[])values.get(2)));
-    assertEquals(new TestException("hello"), values.get(3));
+    assertEquals(new AssertionError("hello"), values.get(3));
     assertNull(values.get(4));
   }
   
-  private static class TestException extends Exception {
+  private static class AssertionError extends Exception {
 
-    public TestException(String message) {
+    public AssertionError(String message) {
       super(message);
     }
 
     @Override
     public boolean equals(Object o) {
-      if(!(o instanceof TestException)) {
+      if(!(o instanceof AssertionError)) {
         return false;
       }
-      if(!((TestException) o ).getMessage().equals(getMessage())) {
+      if(!((AssertionError) o ).getMessage().equals(getMessage())) {
         return false;
       }
       return true;


Mime
View raw message