geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [26/51] [partial] incubator-geode git commit: GEODE-837: update tests from JUnit3 to JUnit4
Date Thu, 09 Jun 2016 17:05:43 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
index 421ab5b..0d1fea9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/SystemFailureDUnitTest.java
@@ -16,24 +16,34 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static com.gemstone.gemfire.test.dunit.Assert.*;
+
+import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.concurrent.atomic.AtomicInteger;
+
 import com.gemstone.gemfire.CancelException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.util.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.ExpirationAction;
+import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionEvent;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.RMIException;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import util.TestException;
-
-import junit.framework.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * This class tests the response of GemFire to various
@@ -41,19 +51,15 @@ import junit.framework.Assert;
  * 
  * @since GemFire 5.1
  */
+@Category(DistributedTest.class)
 public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   
   static final String REGION_NAME = "SystemFailureDUnitTest";
   static final Scope SCOPE = Scope.DISTRIBUTED_ACK;
   
   volatile static Object newValue, oldValue;
-  
-  public SystemFailureDUnitTest(String name) {
-    super(name);
-  }
-
-  /////////  Public test methods
 
+  @Test
   public void testNullFailure() {
     com.gemstone.gemfire.test.dunit.LogWriterUtils.getLogWriter().info("TODO: this test needs to use VM#bounce.");
     try {
@@ -68,13 +74,13 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   /**
    * @see StackOverflowError
    */
-  public void _testStackOverflow()
+  @Ignore("TODO")
+  @Test
+  public void testStackOverflow()
     throws CacheException, InterruptedException {
     String exceptions =
       StackOverflowError.class.getName() 
       + "||"
-//      + OutOfMemoryError.class.getName()
-//      + "||"
       + AssertionError.class.getName();
     
     try {
@@ -101,7 +107,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testOutOfMemory()
+  @Ignore("TODO")
+  @Test
+  public void testOutOfMemory()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -132,7 +140,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testPersistentOutOfMemory()
+  @Ignore("TODO")
+  @Test
+  public void testPersistentOutOfMemory()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -164,7 +174,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testMemoryMonitor()
+  @Ignore("TODO")
+  @Test
+  public void testMemoryMonitor()
     throws CacheException, InterruptedException {
   
     String exceptions =
@@ -196,7 +208,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
      * @throws CacheException
      * @throws InterruptedException
      */
-    public void _testInternalError()
+    @Ignore("TODO")
+    @Test
+    public void testInternalError()
     throws CacheException, InterruptedException {
       String exceptions =
         InternalError.class.getName()
@@ -226,7 +240,9 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
    * @throws CacheException
    * @throws InterruptedException
    */
-  public void _testUnknownError()
+  @Ignore("TODO")
+  @Test
+  public void testUnknownError()
       throws CacheException, InterruptedException {
     String exceptions =
       UnknownError.class.getName()
@@ -270,11 +286,13 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   }
   
   /**
-     * Create some sort of horrible failure that is <em>not</em>
-     * a VirtualMachineError.
-     */
-    public void _testError()
-    throws CacheException, InterruptedException {
+   * Create some sort of horrible failure that is <em>not</em>
+   * a VirtualMachineError.
+   */
+  @Ignore("TODO")
+  @Test
+  public void testError()
+  throws CacheException, InterruptedException {
     // In this case we do NOT expect a failure
     String exceptions =
       Error.class.getName();
@@ -282,7 +300,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
     try {
       String name = "testError";
       doCreateEntry(name);
-      Assert.assertTrue(doVerifyConnected());
+      assertTrue(doVerifyConnected());
       
        doMessage(
           "<ExpectedException action=add>"
@@ -326,59 +344,37 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
   /**
    * Verify that listener gets called, and exactly once.
    */
-  public void _testListener()
+  @Ignore("TODO")
+  @Test
+  public void testListener()
       throws CacheException, InterruptedException {
 
-  String exceptions =
-      Error.class.getName();
-  try {
-    String name = "testListener";
-    doExec("setListener1");
-    
-    doMessage(
-        "<ExpectedException action=add>"
+    String exceptions =
+        Error.class.getName();
+    try {
+      String name = "testListener";
+      doExec("setListener1");
+
+      doMessage(
+          "<ExpectedException action=add>"
+          + exceptions
+          + "</ExpectedException>");
+      doCreateEntry(name);
+
+      Integer count = (Integer)doExec("getListenerCount");
+      assertEquals(1, count.intValue());
+      doVerifyDisconnected();
+    }
+    finally {
+      doMessage(
+        "<ExpectedException action=remove>"
         + exceptions
         + "</ExpectedException>");
-    doCreateEntry(name);
+      resetVM();
+    }
 
-    Integer count = (Integer)doExec("getListenerCount");
-    Assert.assertEquals(1, count.intValue());
-    doVerifyDisconnected();
   }
-  finally {
-    doMessage(
-      "<ExpectedException action=remove>"
-      + exceptions
-      + "</ExpectedException>");
-    resetVM();
-  }
-
-}
 
-//  protected static void doReset() {
-//    // TODO instead of trying to patch up this VM, Lise should create
-//    // me a brand spanking new one
-//    throw new TestException("Sorry, ask Lise to fix this");
-//    
-//    // You'll have to un-comment some methods in order to make
-//    // the following hack work ONCE on a VM...
-////    try {
-////      Thread.sleep(5000);
-////    }
-////    catch (InterruptedException e) {
-////      fail("interrupted");
-////    }
-////    
-////    SystemFailure.reset(); <--- here
-////    DistributedCacheTestCase.cache = null;
-////
-////    // Discard the existing cache instance
-////    GemFireCache.clearInstance(); <--- here
-////    
-////    // This is just to stop the stat sampler thread
-////    HostStatSampler.emergencyStop(); <--- here
-//  }
-  
   private void resetVM() {
     Host host = Host.getHost(0);
     VM vm = host.getVM(0);
@@ -454,7 +450,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
     }
     
     // At this point, the cache we peeked earlier should be unavailable
-    Assert.assertTrue(GemFireCacheImpl.getInstance() == null);
+    assertTrue(GemFireCacheImpl.getInstance() == null);
     
     // Ditto for the distributed system
     InternalDistributedSystem ids = (InternalDistributedSystem)
@@ -556,7 +552,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       private void forceOutOfMemory() {
         peskyMemory = new ArrayList();
         // Allocate this _before_ exhausting memory :-)
-        final TestException whoops = new TestException("Timeout!");
+        final AssertionError whoops = new AssertionError("Timeout!");
         try {
           for (;;) {
             peskyMemory.add(new long[100000]);
@@ -618,7 +614,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       
       peskyMemory = new ArrayList();
       // Allocate this _before_ exhausting memory :-)
-      final TestException whoops = new TestException("Timeout!");
+      final AssertionError whoops = new AssertionError("Timeout!");
       
       // Fill up a lot of memory
       for (;;) {
@@ -748,7 +744,7 @@ public class SystemFailureDUnitTest extends DistributedCacheTestCase {
       listener = listener_error;
     }
     else {
-      throw new TestException("don't know which listener: " + which);
+      throw new AssertionError("don't know which listener: " + which);
     }
     return listener;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
index fefbc60..667a654 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TestDelta.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+import static org.junit.Assert.*;
+
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
@@ -27,70 +29,70 @@ import com.gemstone.gemfire.InvalidDeltaException;
 
 public final class TestDelta implements Delta, DataSerializable, Cloneable {
 
-    public boolean hasDelta;
-    public String info;
-    public int serializations;
-    public int deserializations;
-    public int deltas;
-    public int clones;
-    
-    public TestDelta() {
-    }
+  public boolean hasDelta;
+  public String info;
+  public int serializations;
+  public int deserializations;
+  public int deltas;
+  public int clones;
+
+  public TestDelta() {
+  }
+
+  public TestDelta(boolean hasDelta, String info) {
+    this.hasDelta = hasDelta;
+    this.info = info;
+  }
 
-    public TestDelta(boolean hasDelta, String info) {
-      this.hasDelta = hasDelta;
-      this.info = info;
-    }
-    
-    public synchronized void checkFields(final int serializations, final int deserializations, final int deltas, final int clones) {
-      DeltaSizingDUnitTest.assertEquals(serializations, this.serializations);
-      DeltaSizingDUnitTest.assertEquals(deserializations, this.deserializations);
-      DeltaSizingDUnitTest.assertEquals(deltas, this.deltas);
-      DeltaSizingDUnitTest.assertEquals(clones, this.clones);
-    }
+  public synchronized void checkFields(final int serializations, final int deserializations, final int deltas, final int clones) {
+    assertEquals(serializations, this.serializations);
+    assertEquals(deserializations, this.deserializations);
+    assertEquals(deltas, this.deltas);
+    assertEquals(clones, this.clones);
+  }
 
-    public synchronized void fromDelta(DataInput in) throws IOException,
-        InvalidDeltaException {
+  public synchronized void fromDelta(DataInput in) throws IOException,
+      InvalidDeltaException {
 //      new Exception("DAN - From Delta Called").printStackTrace();
-      this.hasDelta = true;
-      info = DataSerializer.readString(in);
-      deltas++;
-    }
+    this.hasDelta = true;
+    info = DataSerializer.readString(in);
+    deltas++;
+  }
 
-    public boolean hasDelta() {
-      return hasDelta;
-    }
+  public boolean hasDelta() {
+    return hasDelta;
+  }
 
-    public synchronized void toDelta(DataOutput out) throws IOException {
+  public synchronized void toDelta(DataOutput out) throws IOException {
 //      new Exception("DAN - To Delta Called").printStackTrace();
-      DataSerializer.writeString(info, out);
-    }
+    DataSerializer.writeString(info, out);
+  }
 
-    public synchronized void fromData(DataInput in) throws IOException,
-        ClassNotFoundException {
+  public synchronized void fromData(DataInput in) throws IOException,
+      ClassNotFoundException {
 //      new Exception("DAN - From Data Called").printStackTrace();
-      info = DataSerializer.readString(in);
-      serializations = in.readInt();
-      deserializations = in.readInt();
-      deltas = in.readInt();
-      clones = in.readInt();
-      deserializations++;
-    }
+    info = DataSerializer.readString(in);
+    serializations = in.readInt();
+    deserializations = in.readInt();
+    deltas = in.readInt();
+    clones = in.readInt();
+    deserializations++;
+  }
 
-    public synchronized void toData(DataOutput out) throws IOException {
+  public synchronized void toData(DataOutput out) throws IOException {
 //      new Exception("DAN - To Data Called").printStackTrace();
-      serializations++;
-      DataSerializer.writeString(info, out);
-      out.writeInt(serializations);
-      out.writeInt(deserializations);
-      out.writeInt(deltas);
-      out.writeInt(clones);
-    }
+    serializations++;
+    DataSerializer.writeString(info, out);
+    out.writeInt(serializations);
+    out.writeInt(deserializations);
+    out.writeInt(deltas);
+    out.writeInt(clones);
+  }
 
-    @Override
-    public synchronized Object clone() throws CloneNotSupportedException {
+  @Override
+  public synchronized Object clone() throws CloneNotSupportedException {
 //    new Exception("DAN - Clone Called").printStackTrace();
-      clones++;
-      return super.clone();
-    } 
-  }
\ No newline at end of file
+    clones++;
+    return super.clone();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
index 8c5384a..f3716ea 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TransactionsWithDeltaDUnitTest.java
@@ -19,6 +19,15 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
+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.Delta;
 import com.gemstone.gemfire.InvalidDeltaException;
 import com.gemstone.gemfire.cache.*;
@@ -49,7 +58,8 @@ import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties
 /**
  *
  */
-public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class TransactionsWithDeltaDUnitTest extends JUnit4CacheTestCase {
 
   private static final String D_REFERENCE = "ref";
   private static final String CUSTOMER = "Customer";
@@ -58,8 +68,8 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
   /**
    * @param name
    */
-  public TransactionsWithDeltaDUnitTest(String name) {
-    super(name);
+  public TransactionsWithDeltaDUnitTest() {
+    super();
   }
 
   private Integer createRegionOnServer(VM vm, final boolean startServer, final boolean accessor) {
@@ -204,6 +214,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testTxWithCloning() {
     AttributesFactory af = new AttributesFactory();
     af.setDataPolicy(DataPolicy.REPLICATE);
@@ -212,6 +223,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     basicTest(af.create());
   }
   
+  @Test
   public void testExceptionThrown() {
     AttributesFactory af = new AttributesFactory();
     af.setDataPolicy(DataPolicy.REPLICATE);
@@ -308,6 +320,7 @@ public class TransactionsWithDeltaDUnitTest extends CacheTestCase {
     });
   }
   
+  @Test
   public void testClientServerDelta() {
     Host host = Host.getHost(0);
     VM server = host.getVM(0);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
index 419245d..89f71d9 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/MemoryMonitorJUnitTest.java
@@ -16,7 +16,30 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryPoolMXBean;
+import java.util.Properties;
+import java.util.Set;
+import javax.management.ListenerNotFoundException;
+import javax.management.NotificationEmitter;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.LowMemoryException;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.control.ResourceManager;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
@@ -24,34 +47,16 @@ import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.Resou
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import util.TestException;
 
-import javax.management.ListenerNotFoundException;
-import javax.management.NotificationEmitter;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.util.Properties;
-import java.util.Set;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class MemoryMonitorJUnitTest {
   private static Logger logger = LogService.getLogger();
   
   public static final int SYSTEM_LISTENERS = 1;
+
   DistributedSystem ds;
   GemFireCacheImpl cache;
+
   @Before
   public void setUp() throws Exception {
     Properties p = new Properties();
@@ -94,7 +99,6 @@ public class MemoryMonitorJUnitTest {
    * 2. listeners are invoked
    * 3. duplicate safe and critical events are not delivered
    * 4. stats are updated
-   * @throws Exception
    */
   @Test
   public void testInvokeListeners() throws Exception{
@@ -353,7 +357,7 @@ public class MemoryMonitorJUnitTest {
       caughtException = true;
     }
     if(expectLowMemEx && !caughtException){
-      throw new TestException("An expected exception was not thrown");
+      throw new AssertionError("An expected exception was not thrown");
     }
     //make region healthy
     heapMonitor.updateStateAndSendEvent(91);
@@ -361,7 +365,7 @@ public class MemoryMonitorJUnitTest {
     try{
       region.put("key-1", "value-2");      
     } catch(LowMemoryException low){      
-      throw new TestException("Unexpected exception:",low);
+      throw new AssertionError("Unexpected exception:",low);
     }
     if (useTransaction) {
       cache.getCacheTransactionManager().commit();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
index 488dcf6..e16f1ae 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationDUnitTest.java
@@ -16,7 +16,48 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyBoolean;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+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.CacheLoader;
+import com.gemstone.gemfire.cache.CacheLoaderException;
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EvictionAction;
+import com.gemstone.gemfire.cache.EvictionAttributes;
+import com.gemstone.gemfire.cache.LoaderHelper;
+import com.gemstone.gemfire.cache.PartitionAttributes;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEvent;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventListener;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueue;
@@ -28,31 +69,36 @@ import com.gemstone.gemfire.cache.partition.PartitionRebalanceInfo;
 import com.gemstone.gemfire.cache.partition.PartitionRegionHelper;
 import com.gemstone.gemfire.cache.partition.PartitionRegionInfo;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.BucketRegion;
+import com.gemstone.gemfire.internal.cache.ColocationHelper;
+import com.gemstone.gemfire.internal.cache.DiskStoreImpl;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.internal.cache.PRHARedundancyProvider;
+import com.gemstone.gemfire.internal.cache.PartitionedRegion;
+import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore;
 import com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter;
 import com.gemstone.gemfire.internal.cache.partitioned.BucketCountLoadProbe;
 import com.gemstone.gemfire.internal.cache.partitioned.LoadProbe;
-import com.gemstone.gemfire.test.dunit.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.TimeoutException;
-
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.AsyncInvocation;
+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.SerializableCallable;
+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.cache.internal.JUnit4CacheTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-/**
- *
- */
 @SuppressWarnings("synthetic-access")
-public class RebalanceOperationDUnitTest extends CacheTestCase {
+@Category(DistributedTest.class)
+public class RebalanceOperationDUnitTest extends JUnit4CacheTestCase {
 
   private static final long MAX_WAIT = 60;
   
@@ -68,17 +114,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     System.clearProperty(DistributionConfig.GEMFIRE_PREFIX + "resource.manager.threads");
   }
 
-  /**
-   * @param name
-   */
-  public RebalanceOperationDUnitTest(String name) {
-    super(name);
-  }
-  
+  @Test
   public void testRecoverRedundancySimulation() {
     recoverRedundancy(true);
   }
    
+  @Test
   public void testRecoverRedundancy() {
     recoverRedundancy(false);
   }
@@ -284,10 +325,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
 
+  @Test
   public void testEnforceIP() {
     enforceIp(false);
   }
   
+  @Test
   public void testEnforceIPSimulation() {
     enforceIp(true);
   }
@@ -399,10 +442,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testEnforceZone() {
     enforceZone(false);
   }
   
+  @Test
   public void testEnforceZoneSimulation() {
     enforceZone(true);
   }
@@ -603,6 +648,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testEnforceZoneWithMultipleRegions() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -805,10 +851,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return results;
   }
   
+  @Test
   public void testRecoverRedundancyBalancingSimulation() {
     recoverRedundancyBalancing(true);
   }
   
+  @Test
   public void testRecoverRedundancyBalancing() {
     recoverRedundancyBalancing(false);
   }
@@ -936,6 +984,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return (DistributedMember) vm.invoke(createPrRegion);
   }
   
+  @Test
   public void testRecoverRedundancyBalancingIfCreateBucketFails() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1073,10 +1122,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     vm2.invoke(checkRedundancyFixed);
   }
   
+  @Test
   public void testRecoverRedundancyColocatedRegionsSimulation() {
     recoverRedundancyColocatedRegions(true);
   }
   
+  @Test
   public void testRecoverRedundancyColocatedRegions() {
     recoverRedundancyColocatedRegions(false);
   }
@@ -1199,6 +1250,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyParallelAsyncEventQueueSimulation() throws NoSuchFieldException, SecurityException {
     Invoke.invokeInEveryVM(new SerializableRunnable() {
 
@@ -1214,6 +1266,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyParallelAsyncEventQueue() {
     recoverRedundancyParallelAsyncEventQueue(false);
   }
@@ -1382,6 +1435,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     return member1;
   }
   
+  @Test
   public void testCancelOperation() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1495,6 +1549,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test that the rebalancing operation picks up on 
    * a concurrent membership change
    */
+  @Test
   public void testMembershipChange() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -1593,10 +1648,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   }
   
   
+  @Test
   public void testMoveBucketsNoRedundancySimulation() {
     moveBucketsNoRedundancy(true);
   }
   
+  @Test
   public void testMoveBucketsNoRedundancy() {
     moveBucketsNoRedundancy(false);
   }
@@ -1721,10 +1778,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testFilterRegionsSimulation() {
     filterRegions(true);
   }
   
+  @Test
   public void testFilterRegions() {
     filterRegions(false);
   }
@@ -1865,10 +1924,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testMoveBucketsWithRedundancySimulation() {
     moveBucketsWithRedundancy(true);
   }
 
+  @Test
   public void testMoveBucketsWithRedundancy() {
     moveBucketsWithRedundancy(false);
   }
@@ -1989,6 +2050,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   /** A test that the stats when overflowing entries to disk
    * are correct and we still rebalance correctly
    */
+  @Test
   public void testMoveBucketsOverflowToDisk() throws Throwable {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2199,6 +2261,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
   /**
    * Test to make sure we balance buckets between three hosts with redundancy
    */
+  @Test
   public void testMoveBucketsNestedPR() {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -2311,10 +2374,12 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     vm2.invoke(checkBalance);
   }
   
+  @Test
   public void testMoveBucketsColocatedRegionsSimulation() {
     moveBucketsColocatedRegions(true);
   }
   
+  @Test
   public void testMoveBucketsColocatedRegions() {
     moveBucketsColocatedRegions(false);
   }
@@ -2444,6 +2509,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForPut() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2456,6 +2522,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForInvalidate() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2468,6 +2535,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForDestroy() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2480,6 +2548,7 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
    * Test to make sure that moving primaries waits for a put
    * @throws Exception
    */
+  @Test
   public void testWaitForCacheLoader() throws Exception {
     runTestWaitForOperation(new Operation() {
       public void execute(Region region, Integer key) {
@@ -2640,18 +2709,22 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     }
   }
   
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceSimulation() throws Throwable {
     recoverRedundancyWithOfflinePersistence(true, false);
   }
    
+  @Test
   public void testRecoverRedundancyWithOfflinePersistence() throws Throwable {
     recoverRedundancyWithOfflinePersistence(false, false);
   }
   
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceAccessorSimulation() throws Throwable {
     recoverRedundancyWithOfflinePersistence(true, true);
   }
    
+  @Test
   public void testRecoverRedundancyWithOfflinePersistenceAccessor() throws Throwable {
     recoverRedundancyWithOfflinePersistence(false, true);
   }
@@ -2909,14 +2982,17 @@ public class RebalanceOperationDUnitTest extends CacheTestCase {
     assertEquals(vm2Buckets, getBucketList("region1", vm2));
   }
   
+  @Test
   public void testMoveBucketsWithUnrecoveredValues() {
     moveBucketsWithUnrecoveredValuesRedundancy(false);
   }
   
+  @Test
   public void testBalanceBucketsByCountSimulation() {
     balanceBucketsByCount(true);
   }
   
+  @Test
   public void testBalanceBucketsByCount() {
     balanceBucketsByCount(false);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
index 49e07b4..8b9bbaf 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncGetInMemPerfJUnitTest.java
@@ -16,41 +16,32 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
- * 
  * Disk region Perf test for Overflow only with ASync writes. 1) Performance of
  * get operation for entry in memory.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
 //    Properties properties = new Properties();
     diskProps.setBytesThreshold(10000l);
@@ -61,10 +52,8 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,21 +62,17 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
     }
   }
 
- 
   private static int ENTRY_SIZE = 1024;
   
   /* OP_COUNT can be increased/decrease as per the requirement.
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
-  
   private static int OP_COUNT = 1000;
 
   @Test
-  public void testPopulatefor1Kbwrites()
-  {
+  public void testPopulatefor1Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -129,8 +114,5 @@ public class DiskRegOverflowAsyncGetInMemPerfJUnitTest extends DiskRegionTesting
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is in memory :" + statsGet);
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
index dcb6af1..be87bc1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowAsyncJUnitPerformanceTest.java
@@ -16,12 +16,10 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -40,17 +38,24 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * which will fault in.
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private static int ENTRY_SIZE = 1024 * 5;
+
+  /**
+   * Do not change the value OP_COUNT = 400
+   * The test case is dependent on this value.
+   */
+  private static int OP_COUNT = 400;
+
+  private static int HALF_OP_COUNT = OP_COUNT / 2;
+
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setTimeInterval(1000l);
     diskProps.setBytesThreshold(10000l);
@@ -58,13 +63,10 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
         diskProps);
     log = ds.getLogWriter();
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,20 +75,8 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
     }
   }
 
- 
-  private static int ENTRY_SIZE = 1024 * 5;
-  
- /* Do not change the value OP_COUNT = 400
-  * The test case is dependent on this value.
-  */
-  
-  private static int OP_COUNT = 400;
-
-  private static int HALF_OP_COUNT = OP_COUNT / 2;
-
   @Test
-  public void testPopulatefor5Kbwrites()
-  {
+  public void testPopulatefor5Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
     LRUStatistics lruStats = getLRUStats(region);
     // Put in larger stuff until we start evicting
@@ -153,15 +143,10 @@ public class DiskRegOverflowAsyncJUnitPerformanceTest extends DiskRegionTestingB
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is fauting in :" + statsGet);
-
   }
 
-  protected LRUStatistics getLRUStats(Region region)
-  {
+  private LRUStatistics getLRUStats(Region region) {
     return ((LocalRegion)region).getEvictionController().getLRUHelper()
         .getStats();
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
index 95a456c..223f04e 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest.java
@@ -16,16 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
@@ -34,35 +30,36 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 /**
  * Disk region Perf test for Overflow only with Sync writes. 1) Performance of
  * get operation for entry in memory.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskRegionTestingBase {
+
+  private static int ENTRY_SIZE = 1024;
+
+  private static int OP_COUNT = 10000;
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
+  @Override
+  protected final void preSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
-    super.setUp();
+  }
 
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setOverFlowCapacity(100000);
     region = DiskRegionHelperFactory
-        .getSyncOverFlowOnlyRegion(cache, diskProps);
-    
+      .getSyncOverFlowOnlyRegion(cache, diskProps);
+
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -71,15 +68,8 @@ public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskReg
     }
   }
 
-  
-
-  private static int ENTRY_SIZE = 1024;
-
-  private static int OP_COUNT = 10000;
-
   @Test
-  public void testPopulatefor1Kbwrites()
-  {
+  public void testPopulatefor1Kbwrites() {
 //    RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -122,8 +112,5 @@ public class DiskRegOverflowSyncGetInMemPerfJUnitPerformanceTest extends DiskReg
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is in memory :" + statsGet);
-
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
index 208b39f..945a3e5 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegOverflowSyncJUnitPerformanceTest.java
@@ -16,22 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
 import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-import com.gemstone.gemfire.internal.cache.*;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
@@ -40,19 +38,26 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * which will fault in.
  */
 @Category(IntegrationTest.class)
-public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBase {
+
+  private static int ENTRY_SIZE = 1024 * 5;
+
+  /**
+   * Do not change the value OP_COUNT = 400
+   * The test case is dependent on this value.
+   */
+  private static int OP_COUNT = 400;
+
+  private static int HALF_OP_COUNT = OP_COUNT / 2;
 
-  LogWriter log = null;
+  private static int counter = 0;
 
-  static int counter = 0;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setOverFlowCapacity(1000);
     region = DiskRegionHelperFactory
@@ -61,10 +66,8 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -73,20 +76,8 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
     }
   }
 
- 
-  private static int ENTRY_SIZE = 1024 * 5;
-
-  /* Do not change the value OP_COUNT = 400
-   * The test case is dependent on this value.
-   */
-  
-  private static int OP_COUNT = 400;
-
-  private static int HALF_OP_COUNT = OP_COUNT / 2;
-
   @Test
-  public void testPopulatefor5Kbwrites()
-  {
+  public void testPopulatefor5Kbwrites() throws Exception {
 //    RegionAttributes ra = region.getAttributes();
 
     LRUStatistics lruStats = getLRUStats(region);
@@ -155,15 +146,11 @@ public class DiskRegOverflowSyncJUnitPerformanceTest extends DiskRegionTestingBa
         + " bytes/sec=" + bytesPerSecGet;
     log.info(statsGet);
     System.out.println("Perf Stats of get which is fauting in :" + statsGet);
-
   }
 
-  protected LRUStatistics getLRUStats(Region region)
-  {
+  private LRUStatistics getLRUStats(Region region) {
     return ((LocalRegion)region).getEvictionController().getLRUHelper()
         .getStats();
-
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
index b014cb2..2031fec 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowAsyncRollingOpLogJUnitTest.java
@@ -16,19 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.LogWriter;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.internal.cache.CacheObserverAdapter;
+import com.gemstone.gemfire.internal.cache.CacheObserverHolder;
+import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
+import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
+import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.internal.cache.lru.LRUStatistics;
-import com.gemstone.gemfire.internal.cache.*;
 import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
@@ -37,28 +38,22 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  * 1) Performance of Get Operation for Entry faulting in from current Op Log 2)
  * Performance of Get operation for Entry faulting in from previous Op Log 3)
  * Performance of Get operation for Entry faulting in from H Tree
- * 
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
-    DiskRegionTestingBase
-{
+public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends DiskRegionTestingBase {
 
+  private static int counter = 0;
 
-  
-  LogWriter log = null;
+  private static int ENTRY_SIZE = 1024;
 
-  static int counter = 0;
+  private volatile boolean afterHavingCompacted = false;
 
-  private static int ENTRY_SIZE = 1024;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setRegionName("OverflowAsyncRollingOpLogRegion");
     diskProps.setDiskDirs(dirs);
     this.log = ds.getLogWriter();
@@ -69,13 +64,10 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     diskProps.setMaxOplogSize(10485760l);
     region = DiskRegionHelperFactory.getAsyncOverFlowOnlyRegion(cache,
         diskProps);
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
+  @Override
+  protected final void postTearDown() throws Exception {
     if (cache != null) {
       cache.close();
     }
@@ -84,8 +76,6 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     }
   }
 
-  
-
   @Test
   public void testGetPerfRollingOpog()
   {
@@ -94,7 +84,7 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
     
   }
 
-  public void populateFirst0k_10Kbwrites()
+  private void populateFirst0k_10Kbwrites()
   {
     
    final byte[] value = new byte[ENTRY_SIZE];
@@ -128,9 +118,8 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
             + statsGet);
 
   }
-  
-  protected volatile boolean afterHavingCompacted = false;
-  public void populateSecond10kto20kwrites()
+
+  private void populateSecond10kto20kwrites()
   {
     afterHavingCompacted = false;
     DiskRegionTestingBase.setCacheObserverCallBack();
@@ -208,11 +197,12 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
             + statsGet2);
     DiskRegionTestingBase.unSetCacheObserverCallBack();
   }
-/**
- * getLRUStats
- * @param region1
- * @return
- */
+
+  /**
+   * getLRUStats
+   * @param region1
+   * @return
+   */
   protected LRUStatistics getLRUStats(Region region1)
   {
     return ((LocalRegion)region1).getEvictionController().getLRUHelper()
@@ -221,4 +211,3 @@ public class DiskRegionOverflowAsyncRollingOpLogJUnitTest extends
   }
 
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
index d94cf73..da0bb5e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionOverflowSyncRollingOpLogJUnitTest.java
@@ -51,10 +51,8 @@ public class DiskRegionOverflowSyncRollingOpLogJUnitTest extends
 
   DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     this.log = ds.getLogWriter();
     diskProps.setRolling(true);
@@ -62,16 +60,8 @@ public class DiskRegionOverflowSyncRollingOpLogJUnitTest extends
     diskProps.setCompactionThreshold(100);
     region = DiskRegionHelperFactory
         .getSyncOverFlowOnlyRegion(cache, diskProps);
-
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-    
-  }
-  
   @Test
   public void testGetPerfRollingOpog()
   {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
index 5ec4af8..feef5c7 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPerfJUnitPerformanceTest.java
@@ -16,17 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
@@ -37,43 +35,28 @@ import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 /**
  * Consolidated Disk Region Perftest. Overflow, Persist, OverflowWithPersist
  * modes are tested for Sync, AsyncWithBuffer and AsyncWithoutBufer writes.
- *  
  */
 @Category(PerformanceTest.class)
 @Ignore("Tests have no assertions")
-public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
-{
-  LogWriter log = null;
+public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  String stats = null;
+  private static int counter = 0;
 
-  String stats_ForSameKeyputs = null;
+  private LogWriter log = null;
 
-  static int counter = 0;
+  private String stats = null;
 
-  // protected static File[] dirs = null;
+  private String stats_ForSameKeyputs = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-
-  }
-
-  //*********Test Cases **************
-  //********Overflowonly tests *********
   @Test
-  public void testOverflowSync1()
-  {
+  public void testOverflowSync1() throws Exception {
     try {
       //Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowSync1Dir1");
@@ -116,8 +99,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testOverflowSync1
 
   @Test
-  public void testOverflowASyncWithBuffer2()
-  {
+  public void testOverflowASyncWithBuffer2() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithBuffer2Dir1");
@@ -161,8 +143,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
      } //end of testOverflowASyncWithBuffer2
 
   @Test
-  public void testOverflowASyncWithoutBuffer3()
-  {
+  public void testOverflowASyncWithoutBuffer3() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithoutBuffer3Dir1");
@@ -207,10 +188,8 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testOverflowASyncWithoutBuffer3
 
-  //******** PersistOnly Tests ****************
   @Test
-  public void testpersistSync4()
-  {
+  public void testpersistSync4() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistSync4Dir1");
@@ -252,8 +231,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistSync4
 
   @Test
-  public void testpersistASyncWithBuffer5()
-  {
+  public void testpersistASyncWithBuffer5() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistASyncWithBuffer5Dir1");
@@ -298,8 +276,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistASyncWithBuffer5
 
   @Test
-  public void testPersistASyncWithoutBuffer6()
-  {
+  public void testPersistASyncWithoutBuffer6() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistASyncWithoutBuffer6Dir1");
@@ -345,10 +322,8 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testPersistASyncWithoutBuffer
 
-  //*************Persist with Overflow tests ****************
   @Test
-  public void testPersistOverflowSync7()
-  {
+  public void testPersistOverflowSync7() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowSync7Dir1");
@@ -392,8 +367,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testPersistOverflowSync
 
   @Test
-  public void testPersistOverflowASyncWithBuffer8()
-  {
+  public void testPersistOverflowASyncWithBuffer8() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithBuffer8Dir1");
@@ -440,8 +414,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
   } //end of testpersistOverflowASyncWithBuffer8
 
   @Test
-  public void testPersistOverflowASyncWithoutBuffer9()
-  {
+  public void testPersistOverflowASyncWithoutBuffer9() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithoutBuffer9Dir1");
@@ -487,7 +460,6 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     
   } //end of testPersistOverflowASyncWithoutBuffer9
 
-  //************** test data population *******************
   public static int ENTRY_SIZE = 1024;
   
   /**
@@ -495,15 +467,12 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
-  
   public static int OP_COUNT = 100;
 
   public static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
-  public void populateData()
-  {
+  public void populateData() {
     //Put for validation.
     putForValidation(region);
     
@@ -530,8 +499,7 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     log.info(stats);
   }
 
-  public void populateDataPutOnSameKey()
-  {
+  public void populateDataPutOnSameKey() {
 //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -556,15 +524,13 @@ public class DiskRegionPerfJUnitPerformanceTest extends DiskRegionTestingBase
     log.info(stats_ForSameKeyputs);
   }
 
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     for (int i = 0; i < 4; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
         files[j].delete();
       }
     }
-
   }
 
 }// end of DiskRegionPerfJUnitTest

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
index f086325..8f6e14f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionPersistOnlySyncJUnitTest.java
@@ -16,6 +16,13 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
@@ -25,32 +32,19 @@ import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
 import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.util.Arrays;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 /**
  * Disk region perf test for Persist only with sync writes.
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
-{
+public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase {
 
-  LogWriter log = null;
+  private LogWriter log = null;
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     diskProps.setPersistBackup(true);
     region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL);
@@ -58,29 +52,19 @@ public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-  }
-
-  
-
   private static int ENTRY_SIZE = 1024;
   
   /* OP_COUNT can be increased/decrease as per the requirement.
    * If required to be set as higher value such as 1000000
    * one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
-   *    
    */
   private static int OP_COUNT = 1000;
 
   private static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
   @Test
-  public void testPopulate1kbwrites()
-  {
+  public void testPopulate1kbwrites() {
     RegionAttributes ra = region.getAttributes();
 //    final String key = "K";
     final byte[] value = new byte[ENTRY_SIZE];
@@ -172,8 +156,7 @@ public class DiskRegionPersistOnlySyncJUnitTest extends DiskRegionTestingBase
   }
 
   @Test
-  public void testPopulate5kbwrites()
-  {
+  public void testPopulate5kbwrites() {
     ENTRY_SIZE = 1024 * 5;
     
     /* OP_COUNT can be increased/decrease as per the requirement.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
index 1c06543..10a6f20 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/diskPerf/DiskRegionRollOpLogJUnitPerformanceTest.java
@@ -16,66 +16,52 @@
  */
 package com.gemstone.gemfire.internal.cache.diskPerf;
 
-import java.util.*;
+import static org.junit.Assert.*;
+
 import java.io.File;
+import java.util.Arrays;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
-import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.internal.cache.*;
+import com.gemstone.gemfire.internal.cache.DiskRegionHelperFactory;
+import com.gemstone.gemfire.internal.cache.DiskRegionProperties;
+import com.gemstone.gemfire.internal.cache.DiskRegionTestingBase;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Consolidated Disk Region Perftest. Overflow, Persist, OverflowWithPersist
  * modes are tested for Sync, AsyncWithBuffer and AsyncWithoutBufer writes.
  * Roling oplog is set to true with maxOplogSize = 20 mb
- *  
  */
 @Category(IntegrationTest.class)
-public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBase
-{
+public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBase {
 
-  DiskRegionProperties diskProps = new DiskRegionProperties();
+  private DiskRegionProperties diskProps = new DiskRegionProperties();
 
-  LogWriter log = null;
+  private LogWriter log = null;
 
-  String stats = null;
+  private String stats = null;
 
-  String stats_ForSameKeyputs = null;
+  private String stats_ForSameKeyputs = null;
 
   /**
    * To run DiskRegionRollOpLogPerfJUnitTest to produce the Perf numbers set
    * runPerfTest to true. Also ,one needs to set the VM heap size accordingly.
    * (For example:Default setting in build.xml is <jvmarg value="-Xmx256M"/>
    */
-  boolean runPerfTest = false;
+  private boolean runPerfTest = false;
 
-  @Before
-  public void setUp() throws Exception
-  {
-    super.setUp();
+  @Override
+  protected final void postSetUp() throws Exception {
     diskProps.setDiskDirs(dirs);
     log = ds.getLogWriter();
   }
 
-  @After
-  public void tearDown() throws Exception
-  {
-    super.tearDown();
-
-  }
-
-  //*********Test Cases **************
-  //********Overflowonly tests *********
   @Test
-  public void testOverflowSyncRollOlg1()
-  {
+  public void testOverflowSyncRollOlg1() {
     try {
       //Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowSyncRollOlg1Dir1");
@@ -124,8 +110,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testOverflowSync1
 
   @Test
-  public void testOverflowASyncWithBufferRollOlg2()
-  {
+  public void testOverflowASyncWithBufferRollOlg2() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithBufferRollOlg2Dir1");
@@ -177,8 +162,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testOverflowASyncWithBuffer2
 
   @Test
-  public void testOverflowASyncWithoutBufferRollOlg3()
-  {
+  public void testOverflowASyncWithoutBufferRollOlg3() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testOverflowASyncWithoutBufferRollOlg3Dir1");
@@ -229,10 +213,8 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     deleteFiles();
   } //end of testOverflowASyncWithoutBuffer3
 
-  //******** PersistOnly Tests ****************
   @Test
-  public void testpersistSyncRollOlg4()
-  {
+  public void testpersistSyncRollOlg4() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistSyncRollOlg4Dir1");
@@ -281,8 +263,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistSync4
 
   @Test
-  public void testpersistASyncWithBufferRollOlg5()
-  {
+  public void testpersistASyncWithBufferRollOlg5() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testpersistASyncWithBufferRollOlg5Dir1");
@@ -334,8 +315,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistASyncWithBuffer5
 
   @Test
-  public void testPersistASyncWithoutBufferRollOlg6()
-  {
+  public void testPersistASyncWithoutBufferRollOlg6() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistASyncWithoutBufferRollOlg6Dir1");
@@ -386,10 +366,8 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     closeDown();
   } //end of testPersistASyncWithoutBuffer
 
-  //*************Persist with Overflow tests ****************
   @Test
-  public void testPersistOverflowSyncRollOlg7()
-  {
+  public void testPersistOverflowSyncRollOlg7() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowSyncRollOlg7Dir1");
@@ -440,8 +418,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testPersistOverflowSync
 
   @Test
-  public void testPersistOverflowASyncWithBufferRollOlg8()
-  {
+  public void testPersistOverflowASyncWithBufferRollOlg8() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithBufferRollOlg8Dir1");
@@ -494,8 +471,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
   } //end of testpersistOverflowASyncWithBuffer8
 
   @Test
-  public void testPersistOverflowASyncWithoutBufferRollOlg9()
-  {
+  public void testPersistOverflowASyncWithoutBufferRollOlg9() {
     try {
       //    Create four Dirs for Disk Dirs
       File file1 = new File("testPersistOverflowASyncWithoutBufferRollOlg9Dir1");
@@ -547,7 +523,6 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     closeDown();
   } //end of testPersistOverflowASyncWithoutBuffer9
 
-  //************** test data population *******************
   public static int ENTRY_SIZE = 1024;
 
   /**
@@ -555,15 +530,12 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
    * be set as higher value such as 1000000, one needs to set the VM heap size
    * accordingly. (For example:Default setting in build.xml is <jvmarg
    * value="-Xmx256M"/>
-   *  
    */
-
   public static int OP_COUNT = 1000;
 
   public static boolean UNIQUE_KEYS = Boolean.getBoolean("DRP.UNIQUE_KEYS");
 
-  public void populateData0to60k()
-  {
+  public void populateData0to60k() {
     final byte[] value = new byte[ENTRY_SIZE];
     Arrays.fill(value, (byte)77);
     for (int i = 0; i < 60000; i++) {
@@ -571,11 +543,9 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
       // System.out.println(i);
     }
     System.out.println(" done with putting first 60k entries");
-
   }
 
-  public void populateData60kto100k()
-  {
+  public void populateData60kto100k() {
     //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -599,8 +569,7 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     log.info(stats);
   }
 
-  public void populateDataPutOnSameKey()
-  {
+  public void populateDataPutOnSameKey() {
     //  Put for validation.
     putForValidation(region);
     final byte[] value = new byte[ENTRY_SIZE];
@@ -624,15 +593,12 @@ public class DiskRegionRollOpLogJUnitPerformanceTest extends DiskRegionTestingBa
     log.info(stats_ForSameKeyputs);
   }
 
-  protected static void deleteFiles()
-  {
+  protected static void deleteFiles() {
     for (int i = 0; i < 4; i++) {
       File[] files = dirs[i].listFiles();
       for (int j = 0; j < files.length; j++) {
         files[j].delete();
       }
     }
-
   }
-
 }// end of DiskRegionRollOpLogPerfJUnitTest

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
index 8875895..8a0605f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java
@@ -16,11 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.cache.*;
+import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.*;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
 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.execute.*;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.Function;
+import com.gemstone.gemfire.cache.execute.FunctionAdapter;
+import com.gemstone.gemfire.cache.execute.FunctionContext;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
@@ -30,28 +48,21 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.tier.ClientHandShake;
 import com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection;
-import com.gemstone.gemfire.test.dunit.DistributedTestCase;
 import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
 import com.gemstone.gemfire.test.dunit.Host;
 import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
+import com.gemstone.gemfire.test.junit.categories.DistributedTest;
 
-import java.util.ArrayList;
-import java.util.Properties;
-
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.LOCATORS;
-import static com.gemstone.gemfire.distributed.DistributedSystemConfigProperties.MCAST_PORT;
-
+@Category(DistributedTest.class)
 @SuppressWarnings("serial")
-public class Bug51193DUnitTest extends DistributedTestCase {
+public class Bug51193DUnitTest extends JUnit4DistributedTestCase {
 
-  public Bug51193DUnitTest(String name) {
-    super(name);
-  }
 
-  private static GemFireCacheImpl cache;
-  
   private static final String REGION_NAME = "Bug51193DUnitTest_region";
-  
+
+  private static GemFireCacheImpl cache;
+
   private static VM server0;
   
   private VM client0;
@@ -89,10 +100,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
       Properties props = new Properties();
       props.setProperty(LOCATORS, "");
       props.setProperty(MCAST_PORT, "0");
-//      props.setProperty("statistic-archive-file", "client_" + OSProcess.getId()
-//          + ".gfs");
-//      props.setProperty("statistic-sampling-enabled", "true");
-      DistributedSystem ds = new Bug51193DUnitTest("Bug51193DUnitTest")
+      DistributedSystem ds = new Bug51193DUnitTest()
           .getSystem(props);
       ds.disconnect();
       ClientCacheFactory ccf = new ClientCacheFactory(props);
@@ -114,7 +122,7 @@ public class Bug51193DUnitTest extends DistributedTestCase {
     Properties props = new Properties();
     props.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
 
-    Bug51193DUnitTest test = new Bug51193DUnitTest("Bug51193DUnitTest");
+    Bug51193DUnitTest test = new Bug51193DUnitTest();
     DistributedSystem ds = test.getSystem(props);
     ds.disconnect();
     cache = (GemFireCacheImpl)CacheFactory.create(test.getSystem());
@@ -176,26 +184,32 @@ public class Bug51193DUnitTest extends DistributedTestCase {
     client0.invoke(() -> Bug51193DUnitTest.executeFunction( mode, timeout ));
   }
 
+  @Test
   public void testExecuteFunctionReadsDefaultTimeout() throws Throwable {
     doTest(false, 0, "server");
   }
 
+  @Test
   public void testExecuteRegionFunctionReadsDefaultTimeout() throws Throwable {
     doTest(false, 0, "region");
   }
 
+  @Test
   public void testExecuteRegionFunctionSingleHopReadsDefaultTimeout() throws Throwable {
     doTest(true, 0, "region");
   }
 
+  @Test
   public void testExecuteFunctionReadsTimeout() throws Throwable {
     doTest(false, 6000, "server");
   }
 
+  @Test
   public void testExecuteRegionFunctionReadsTimeout() throws Throwable {
     doTest(false, 6000, "region");
   }
 
+  @Test
   public void testExecuteRegionFunctionSingleHopReadsTimeout() throws Throwable {
     doTest(true, 6000, "region");
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b914df23/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
index 67d66b7..7e396c4 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/ClientServerFunctionExecutionDUnitTest.java
@@ -16,6 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
+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.AttributesFactory;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
@@ -49,6 +58,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.Callable;
 
+@Category(DistributedTest.class)
 public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBase {
   private static final String TEST_FUNCTION1 = TestFunction.TEST_FUNCTION1;
 
@@ -58,8 +68,8 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   static final String retryRegionName = "RetryDataRegion";
   static Region metaDataRegion;
   
-  public ClientServerFunctionExecutionDUnitTest(String name) {
-    super(name);
+  public ClientServerFunctionExecutionDUnitTest() {
+    super();
   }
 
   @Override
@@ -67,6 +77,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     IgnoredException.addIgnoredException("java.net.ConnectException");
   }
 
+  @Test
   public void test_Bug_43126_Function_Not_Registered()
       throws InterruptedException {
     createScenario();
@@ -80,6 +91,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     }
   }
 
+  @Test
   public void test_Bug43126() throws InterruptedException {
     createScenario();
     Function function = new TestFunction(true, TestFunction.TEST_FUNCTION1);
@@ -90,6 +102,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_byName() {
     createScenario();
 
@@ -105,6 +118,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   }
   
   
+  @Test
   public void testServerExecution_sendException() {
     createScenario();
 
@@ -122,6 +136,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_NoLastResult() {
     createScenario();
 
@@ -136,6 +151,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution_NoLastResult( isByName, function, toRegister));
   }
 
+  @Test
   public void testServerExecution_byName_WithoutRegister() {
     createScenario();
 
@@ -152,6 +168,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server 
    */   
+  @Test
   public void testServerExecution_byInlineFunction() {
     createScenario();
     LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
@@ -163,6 +180,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server 
    */   
+  @Test
   public void testServerExecution_byInlineFunction_InvalidAttrbiutes() {
     createScenario();
     LogWriterUtils.getLogWriter().info("ClientServerFunctionExecutionDUnitTest#testServerSingleKeyExecution_byName : Starting test");
@@ -172,6 +190,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the inline function on server
    */
+  @Test
   public void testBug40714() {
     createScenario();
     LogWriterUtils.getLogWriter()
@@ -247,6 +266,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   /*
    * Execution of the function on server using the name of the function
    */   
+  @Test
   public void testServerExecution_SocketTimeOut() {
     createScenario();
     function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -259,6 +279,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
     client.invoke(() -> ClientServerFunctionExecutionDUnitTest.allServerExecution( isByName, function, toRegister));
   }
 
+  @Test
   public void testServerExecution_SocketTimeOut_WithoutRegister() {
     createScenario();
     function = new TestFunction(true,TestFunction.TEST_FUNCTION_SOCKET_TIMEOUT);
@@ -277,6 +298,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * the execution is failover to other available server
    */
   @SuppressWarnings("rawtypes")
+  @Test
   public void testOnServerFailoverWithOneServerDownHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -302,6 +324,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
   }
 
   @SuppressWarnings("rawtypes")
+  @Test
   public void testOnServerFailoverWithTwoServerDownHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -332,6 +355,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * Ensure that the while executing the function if the servers are down then 
    * the execution shouldn't failover to other available server
    */
+  @Test
   public void testOnServerFailoverNonHA()
       throws InterruptedException {
     //The test code appears to trigger this because the first
@@ -360,6 +384,7 @@ public class ClientServerFunctionExecutionDUnitTest extends PRClientServerTestBa
    * As this is the case of HA then system should retry the function execution. After 5th attempt
    * function will send Boolean as last result.
    */
+  @Test
   public void testOnServerExecution_FunctionInvocationTargetException() {
     createScenario();
     function = new TestFunction(true, TestFunction.TEST_FUNCTION_ONSERVER_REEXECUTE_EXCEPTION);



Mime
View raw message