You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/06/03 19:56:48 UTC

[2/7] incubator-geode git commit: Convert junit3 to junit4 and cleanup tests.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
index 2fd169a..281c000 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/lru/LRUClockJUnitTest.java
@@ -16,18 +16,20 @@
  */
 package com.gemstone.gemfire.internal.cache.lru;
 
+import static org.junit.Assert.*;
+
 import java.util.Properties;
 
-import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 
 import com.gemstone.gemfire.StatisticDescriptor;
 import com.gemstone.gemfire.StatisticsFactory;
 import com.gemstone.gemfire.StatisticsType;
 import com.gemstone.gemfire.StatisticsTypeFactory;
-import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.AttributesFactory;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheExistsException;
@@ -41,59 +43,24 @@ import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
 import com.gemstone.gemfire.internal.cache.PlaceHolderDiskRegion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-/**  This class tests the LRUCapacityController's core clock algorithm.  */
+/**
+ * This class tests the LRUCapacityController's core clock algorithm.
+ */
 @Category(IntegrationTest.class)
-public class LRUClockJUnitTest extends junit.framework.TestCase {
+public class LRUClockJUnitTest {
   
-  private String myTestName;
-
-  //static int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS);
-
-  static Properties sysProps = new Properties();
-  static {
-    //sysProps.setProperty("mcast-port", String.valueOf(unusedPort));
-    // a loner is all this test needs
-    sysProps.setProperty("mcast-port", "0");
-    sysProps.setProperty("locators", "");
-  }
+  private Properties sysProps;
 
-  public LRUClockJUnitTest( String name ) {
-    super( name );
-    this.myTestName = name;
-  }
+  @Rule
+  public TestName testName = new TestName();
 
-  protected LRUClockJUnitTest( String prefix, String methodName ) {
-    super( methodName );
-    this.myTestName = prefix + methodName;
-  }
-  
-  /**
-   *  The JUnit setup method
-   *
-   * @exception  Exception  Description of the Exception
-   */
   @Before
   public void setUp() throws Exception {
-    super.setUp();
-    System.out.println( "\n\n### beginning " + this.myTestName + "###" );
-  }
-
-  /**
-   *  The teardown method for JUnit
-   *
-   * @exception  Exception  Description of the Exception
-   */
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-    System.out.println( "###  finished " + this.myTestName + "###" );
+    sysProps = new Properties();
+    sysProps.setProperty("mcast-port", "0");
+    sysProps.setProperty("locators", "");
   }
 
-  /**
-   *  A unit test for JUnit
-   *
-   * @exception  Exception  Description of the Exception
-   */
   @Test
   public void testAddToClockFace() throws Exception {
     NewLRUClockHand clock = getAClockHand( getARegion(), new TestEnableLRU() );
@@ -118,8 +85,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
 
   @Test
-  public void testFIFO() {
-    try {
+  public void testFIFO() throws Exception {
     NewLRUClockHand clock = getAClockHand( getARegion(), new TestEnableLRU() );
 
     for( int i = 0; i < 100; i++ ) {
@@ -147,15 +113,6 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
       le = (LRUTestEntry) clock.getLRUEntry();
     }
     assertTrue( "expected 100, found " + counter, counter == 100);
-    } 
-    catch (VirtualMachineError e) {
-      SystemFailure.initiateFailure(e);
-      throw e;
-    }
-    catch ( Throwable t ) {
-      t.printStackTrace();
-      assertTrue( "failed", false );
-    }
   }
   
   @Test
@@ -275,16 +232,16 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
   
   /** manufacture a node so that a shared type can be used by SharedLRUClockTest. */
-  protected LRUTestEntry getANode( int id ) {
+  private LRUTestEntry getANode( int id ) {
     return new LocalLRUTestEntry( id );
   }
-  
-  public static interface LRUTestEntry extends LRUClockNode {
+
+  private interface LRUTestEntry extends LRUClockNode {
     public int id();
   }
   
   /** test implementation of an LRUClockNode */
-  public static class LocalLRUTestEntry implements LRUTestEntry {
+  private static class LocalLRUTestEntry implements LRUTestEntry {
     
     int id;
     LRUClockNode next;
@@ -301,7 +258,8 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
       recentlyUsed = false;
       evicted = false;
     }
-    
+
+    @Override
     public int id() {
       return id; 
     }
@@ -309,108 +267,121 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     public boolean isTombstone() {
       return false;
     }
-    
+
+    @Override
     public void setNextLRUNode( LRUClockNode next ) {
       this.next = next; 
     }
-    
+
+    @Override
     public LRUClockNode nextLRUNode() {
       return this.next; 
     }
 
+    @Override
     public void setPrevLRUNode( LRUClockNode prev ) {
       this.prev = prev; 
     }
-    
+
+    @Override
     public LRUClockNode prevLRUNode() {
       return this.prev; 
     }
-    
-    
+
+    @Override
     public int updateEntrySize( EnableLRU cc ) {
       return this.size = 1; 
     }
 
+    @Override
     public int updateEntrySize(EnableLRU cc, Object value) {
       return this.size = 1; 
     }
-    
+
+    @Override
     public int getEntrySize() {
       return this.size; 
     }
     
     /** this should only happen with the LRUClockHand sync'ed */
+    @Override
     public void setEvicted() {
       evicted = true;
     }
 
+    @Override
     public void unsetEvicted() {
       evicted = false;
     }
-    
+
+    @Override
     public boolean testEvicted( ) {
       return evicted; 
     }
-    
+
+    @Override
     public boolean testRecentlyUsed() {
       return recentlyUsed;  
     }
-    
+
+    @Override
     public void setRecentlyUsed() {
       recentlyUsed = true;  
     }
-    
+
+    @Override
     public void unsetRecentlyUsed() {
       recentlyUsed = false; 
     }
+
     public LRUClockNode absoluteSelf( ) { return this; }
     public LRUClockNode clearClones( ) { return this; }
     public int cloneCount( ) { return 0; }
   }
 
-
-  public class TestEnableLRU implements EnableLRU {
+  private class TestEnableLRU implements EnableLRU {
 
     private final StatisticsType statType;
 
     {
-    // create the stats type for MemLRU.
-    StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
-    
-    final String bytesAllowedDesc = 
-      "Number of total bytes allowed in this region.";
-    final String byteCountDesc = 
-      "Number of bytes in region.";
-    final String lruEvictionsDesc = 
-      "Number of total entry evictions triggered by LRU.";
-    final String lruEvaluationsDesc = 
-      "Number of entries evaluated during LRU operations.";
-    final String lruGreedyReturnsDesc =
-      "Number of non-LRU entries evicted during LRU operations";
-    final String lruDestroysDesc =
-      "Number of entry destroys triggered by LRU.";
-    final String lruDestroysLimitDesc =
-      "Maximum number of entry destroys triggered by LRU before scan occurs.";
-      
-    statType = f.createType( "TestLRUStatistics",
-      "Statistics about byte based Least Recently Used region entry disposal",
-      new StatisticDescriptor[] {
-        f.createLongGauge("bytesAllowed", bytesAllowedDesc, "bytes" ),
-        f.createLongGauge("byteCount", byteCountDesc, "bytes" ),
-        f.createLongCounter("lruEvictions", lruEvictionsDesc, "entries" ),
-        f.createLongCounter("lruEvaluations", lruEvaluationsDesc, "entries" ),
-        f.createLongCounter("lruGreedyReturns", lruGreedyReturnsDesc, "entries"),
-        f.createLongCounter("lruDestroys", lruDestroysDesc, "entries" ),
-        f.createLongCounter("lruDestroysLimit", lruDestroysLimitDesc, "entries" ),
-      }
-    );
-  }
-
-  
+      // create the stats type for MemLRU.
+      StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
+
+      final String bytesAllowedDesc =
+        "Number of total bytes allowed in this region.";
+      final String byteCountDesc =
+        "Number of bytes in region.";
+      final String lruEvictionsDesc =
+        "Number of total entry evictions triggered by LRU.";
+      final String lruEvaluationsDesc =
+        "Number of entries evaluated during LRU operations.";
+      final String lruGreedyReturnsDesc =
+        "Number of non-LRU entries evicted during LRU operations";
+      final String lruDestroysDesc =
+        "Number of entry destroys triggered by LRU.";
+      final String lruDestroysLimitDesc =
+        "Maximum number of entry destroys triggered by LRU before scan occurs.";
+
+      statType = f.createType( "TestLRUStatistics",
+        "Statistics about byte based Least Recently Used region entry disposal",
+        new StatisticDescriptor[] {
+          f.createLongGauge("bytesAllowed", bytesAllowedDesc, "bytes" ),
+          f.createLongGauge("byteCount", byteCountDesc, "bytes" ),
+          f.createLongCounter("lruEvictions", lruEvictionsDesc, "entries" ),
+          f.createLongCounter("lruEvaluations", lruEvaluationsDesc, "entries" ),
+          f.createLongCounter("lruGreedyReturns", lruGreedyReturnsDesc, "entries"),
+          f.createLongCounter("lruDestroys", lruDestroysDesc, "entries" ),
+          f.createLongCounter("lruDestroysLimit", lruDestroysLimitDesc, "entries" ),
+        }
+      );
+    }
+
+    @Override
     public int entrySize( Object key, Object value ) throws IllegalArgumentException {
       return 1;  
     }
-    
+
+    @Override
     public long limit( ) {
       return 20; 
     }
@@ -418,66 +389,79 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     public boolean usesMem( ) {
       return false; 
     }
-    
+
+    @Override
     public EvictionAlgorithm getEvictionAlgorithm() {
       return EvictionAlgorithm.LRU_ENTRY;
     }
-    
+
+    @Override
     public LRUStatistics getStats() {
       return null;
     }
 
+    @Override
     public EvictionAction getEvictionAction() {
       return EvictionAction.DEFAULT_EVICTION_ACTION;
     }
 
-      public StatisticsType getStatisticsType() {
-        return statType;
-      }
+    @Override
+    public StatisticsType getStatisticsType() {
+      return statType;
+    }
 
-      public String getStatisticsName() {
-        return "TestLRUStatistics";
-      }
+    @Override
+    public String getStatisticsName() {
+      return "TestLRUStatistics";
+    }
 
-      public int getLimitStatId() {
-        return statType.nameToId("bytesAllowed");
+    @Override
+    public int getLimitStatId() {
+      return statType.nameToId("bytesAllowed");
+    }
 
-      }
+    @Override
+    public int getCountStatId() {
+      return statType.nameToId("byteCount");
+    }
 
-      public int getCountStatId() {
-        return statType.nameToId("byteCount");
-      }
+    @Override
+    public int getEvictionsStatId() {
+      return statType.nameToId("lruEvictions");
+    }
 
-      public int getEvictionsStatId() {
-        return statType.nameToId("lruEvictions");
-      }
+    @Override
+    public int getDestroysStatId() {
+      return statType.nameToId("lruDestroys");
+    }
 
-      public int getDestroysStatId() {
-        return statType.nameToId("lruDestroys");
-      }
+    @Override
+    public int getDestroysLimitStatId() {
+      return statType.nameToId("lruDestroysLimit");
+    }
 
-      public int getDestroysLimitStatId() {
-        return statType.nameToId("lruDestroysLimit");
-      }
+    @Override
+    public int getEvaluationsStatId() {
+      return statType.nameToId("lruEvaluations");
+    }
 
-      public int getEvaluationsStatId() {
-        return statType.nameToId("lruEvaluations");
-      }
-      
-      public int getGreedyReturnsStatId() {
-        return statType.nameToId("lruGreedyReturns");
-      }
+    @Override
+    public int getGreedyReturnsStatId() {
+      return statType.nameToId("lruGreedyReturns");
+    }
 
+    @Override
     public boolean mustEvict(LRUStatistics stats, Region region, int delta) {
       throw new UnsupportedOperationException("Not implemented");
     }
 
+    @Override
     public void afterEviction() {
       throw new UnsupportedOperationException("Not implemented");
     }
 
-    public LRUStatistics initStats(Object region, StatisticsFactory sf)
-    {
+    @Override
+    public LRUStatistics initStats(Object region, StatisticsFactory sf) {
       String regionName;
       if (region instanceof Region) {
         regionName = ((Region)region).getName();
@@ -494,7 +478,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
   }
 
   /** overridden in SharedLRUClockTest to test SharedLRUClockHand */
-  protected NewLRUClockHand getAClockHand( Region reg, EnableLRU elru ) {
+  private NewLRUClockHand getAClockHand( Region reg, EnableLRU elru ) {
     return new NewLRUClockHand( reg, elru,new InternalRegionArguments());
   }
   
@@ -511,7 +495,7 @@ public class LRUClockJUnitTest extends junit.framework.TestCase {
     if ( root == null ) {
       root = c.createRegion("root", af.create() );
     }
-    Region sub = root.createSubregion( myTestName, af.create() );
+    Region sub = root.createSubregion( testName.getMethodName(), af.create() );
     return sub;
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
index 95642a2..f44bad6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/snapshot/GFSnapshotJUnitPerformanceTest.java
@@ -22,26 +22,37 @@ import java.util.Map.Entry;
 
 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 junit.framework.TestCase;
-
 import com.gemstone.gemfire.cache.snapshot.SnapshotIterator;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.GFSnapshotExporter;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.GFSnapshotImporter;
 import com.gemstone.gemfire.internal.cache.snapshot.GFSnapshot.SnapshotWriter;
 import com.gemstone.gemfire.internal.cache.snapshot.SnapshotPacket.SnapshotRecord;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.gemstone.gemfire.test.junit.categories.PerformanceTest;
 
-@Category(IntegrationTest.class)
+@Category(PerformanceTest.class)
+@Ignore("Test has no assertions and will always pass")
 public class GFSnapshotJUnitPerformanceTest {
-  private final File f = new File("test.snapshot");
+
   private static final String val = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
 
+  private File f;
+
+  @Before
+  public void setUp() throws Exception {
+    f = new File("test.snapshot");
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    if (f.exists()) {
+      f.delete();
+    }
+  }
+
   @Test
   public void testStreamWritePerformance() throws IOException {
     int i = 0;
@@ -148,11 +159,4 @@ public class GFSnapshotJUnitPerformanceTest {
       out.close();
     }
   }
-  
-  @After
-  public void tearDown() throws Exception {
-    if (f.exists()) {
-      f.delete();
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
index f86c2bf..878b9a7 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerMaxConnectionsJUnitTest.java
@@ -16,16 +16,15 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
+import static org.junit.Assert.*;
+
+import java.io.IOException;
 import java.util.Properties;
 
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.Statistics;
 import com.gemstone.gemfire.StatisticsType;
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -33,9 +32,11 @@ import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.client.*;
-import com.gemstone.gemfire.cache.client.internal.PoolImpl;
+import com.gemstone.gemfire.cache.client.NoAvailableServersException;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.internal.AvailablePort;
@@ -45,35 +46,31 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Make sure max-connections on cache server is enforced
- *
- *
  */
 @Category(IntegrationTest.class)
-public class CacheServerMaxConnectionsJUnitTest
+public class CacheServerMaxConnectionsJUnitTest {
+
+  private static final int MAX_CNXS = 100;
+
+  private static int PORT;
 
-{
+  /** name of the region created */
+  private final String regionName = "region1";
 
   /** connection proxy object for the client */
-  PoolImpl proxy = null;
+  private PoolImpl proxy = null;
 
   /** the distributed system instance for the test */
-  DistributedSystem system;
+  private DistributedSystem system;
 
   /** the cache instance for the test */
-  Cache cache;
-
-  /** name of the region created */
-  final String regionName = "region1";
-
-  private static int PORT;
+  private Cache cache;
 
   /**
    * Close the cache and disconnects from the distributed system
    */
   @After
-  public void tearDown() throws Exception
-
-  {
+  public void tearDown() throws Exception {
     this.cache.close();
     this.system.disconnect();
   }
@@ -87,59 +84,42 @@ public class CacheServerMaxConnectionsJUnitTest
 
   /**
    * Initializes proxy object and creates region for client
-   *
    */
-  private void createProxyAndRegionForClient()
-  {
-    try {
-      //props.setProperty("retryAttempts", "0");
-      PoolFactory pf = PoolManager.createFactory();
-      pf.addServer("localhost", PORT);
-      pf.setMinConnections(0);
-      pf.setPingInterval(10000);
-      pf.setThreadLocalConnections(true);
-      pf.setReadTimeout(2000);
-      pf.setSocketBufferSize(32768);
-      proxy = (PoolImpl)pf.create("junitPool");
-      AttributesFactory factory = new AttributesFactory();
-      factory.setScope(Scope.DISTRIBUTED_ACK);
-      factory.setPoolName("junitPool");
-      RegionAttributes attrs = factory.createRegionAttributes();
-      cache.createVMRegion(regionName, attrs);
-    }
-    catch (Exception ex) {
-      ex.printStackTrace();
-      fail("Failed to initialize client");
-    }
+  private void createProxyAndRegionForClient() {
+    //props.setProperty("retryAttempts", "0");
+    PoolFactory pf = PoolManager.createFactory();
+    pf.addServer("localhost", PORT);
+    pf.setMinConnections(0);
+    pf.setPingInterval(10000);
+    pf.setThreadLocalConnections(true);
+    pf.setReadTimeout(2000);
+    pf.setSocketBufferSize(32768);
+    proxy = (PoolImpl)pf.create("junitPool");
+    AttributesFactory factory = new AttributesFactory();
+    factory.setScope(Scope.DISTRIBUTED_ACK);
+    factory.setPoolName("junitPool");
+    RegionAttributes attrs = factory.createRegionAttributes();
+    cache.createVMRegion(regionName, attrs);
   }
 
-  private final static int MAX_CNXS = 100;
-
   /**
    * Creates and starts the server instance
-   *
+   *�
    */
-  private int createServer()
-  {
+  private int createServer() throws IOException {
     CacheServer server = null;
-    try {
-      Properties p = new Properties();
-      // make it a loner
-      p.put("mcast-port", "0");
-      p.put("locators", "");
-      this.system = DistributedSystem.connect(p);
-      this.cache = CacheFactory.create(system);
-      server = this.cache.addCacheServer();
-      int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-      server.setMaxConnections(MAX_CNXS);
-      server.setMaxThreads(getMaxThreads());
-      server.setPort(port);
-      server.start();
-    }
-    catch (Exception e) {
-      e.printStackTrace();
-      fail("Failed to create server");
-    }
+    Properties p = new Properties();
+    // make it a loner
+    p.put("mcast-port", "0");
+    p.put("locators", "");
+    this.system = DistributedSystem.connect(p);
+    this.cache = CacheFactory.create(system);
+    server = this.cache.addCacheServer();
+    int port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+    server.setMaxConnections(MAX_CNXS);
+    server.setMaxThreads(getMaxThreads());
+    server.setPort(port);
+    server.start();
     return server.getPort();
   }
 
@@ -155,8 +135,7 @@ public class CacheServerMaxConnectionsJUnitTest
    * the put that the Connection object used was new one.
    */
   @Test
-  public void testMaxCnxLimit() throws Exception
-  {
+  public void testMaxCnxLimit() throws Exception {
     PORT = createServer();
     createProxyAndRegionForClient();
     StatisticsType st = this.system.findType("CacheServerStats");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
index 08d964a..9048d19 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationDUnitTest.java
@@ -16,8 +16,7 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import static junit.framework.TestCase.assertNotNull;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -27,13 +26,13 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
+import com.jayway.awaitility.Awaitility;
 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.CacheWriterException;
 import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.EntryEvent;
 import com.gemstone.gemfire.cache.Region;
@@ -51,15 +50,12 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;
-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.cache.internal.JUnit4CacheTestCase;
 import com.gemstone.gemfire.test.junit.categories.DistributedTest;
-import com.jayway.awaitility.Awaitility;
-import com.jayway.awaitility.core.ConditionTimeoutException;
 
 /**
  * Start client 1
@@ -80,20 +76,16 @@ import com.jayway.awaitility.core.ConditionTimeoutException;
 @Category(DistributedTest.class)
 public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
 
-  VM server1 = null;
-
-  VM server2 = null;
-
-  VM client1 = null;
+  private static final String REGION_NAME = "UpdatePropagationDUnitTest_region";
 
-  VM client2 = null;
+  private VM server1 = null;
+  private VM server2 = null;
+  private VM client1 = null;
+  private VM client2 = null;
 
   private int PORT1 ;
-
   private int PORT2 ;
 
-  private static final String REGION_NAME = "UpdatePropagationDUnitTest_region";
-
   @Override
   public final void postSetUp() throws Exception {
     disconnectAllFromDS();
@@ -189,27 +181,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     return servers.stream().anyMatch(location -> location.getPort() == port);
   }
 
-  public void acquireConnectionsAndPutonK1andK2(String host)
-  {
+  private void acquireConnectionsAndPutonK1andK2(String host) {
     Region r1 = getCache().getRegion(Region.SEPARATOR + REGION_NAME);
     r1.put("key1", "server-value1");
     r1.put("key2", "server-value2");
   }
 
-  public void killServer(Integer port )
-  {
+  private void killServer(Integer port ) {
     Iterator iter = getCache().getCacheServers().iterator();
     if (iter.hasNext()) {
       CacheServer server = (CacheServer)iter.next();
       if(server.getPort() == port.intValue()){
         server.stop();
       }
-
     }
   }
 
-  public void startServer(Integer port) throws IOException
-  {
+  private void startServer(Integer port) throws IOException {
     CacheServer server1 = getCache().addCacheServer();
     server1.setPort(port.intValue());
     server1.setNotifyBySubscription(true);
@@ -218,10 +206,8 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
 
   /**
    * Creates entries on the server
-   *
    */
-  public void createEntriesK1andK2()
-  {
+  private void createEntriesK1andK2() {
     Region r1 = getCache().getRegion(Region.SEPARATOR+REGION_NAME);
     assertNotNull(r1);
     if (!r1.containsKey("key1")) {
@@ -241,8 +227,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     }
   }
 
-  public void createClientCache(String host, Integer port1 , Integer port2 ) throws Exception
-  {
+  private void createClientCache(String host, Integer port1 , Integer port2 ) throws Exception {
     ClientCache cache;
     try {
       System.setProperty("gemfire.PoolImpl.DISABLE_RANDOM", "true");
@@ -270,8 +255,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
       .create(REGION_NAME);
   }
 
-  public Integer createServerCache() throws Exception
-  {
+  private Integer createServerCache() throws Exception {
     Cache cache = getCache();
     RegionAttributes attrs = createCacheServerAttributes();
     cache.createRegion(REGION_NAME, attrs);
@@ -284,32 +268,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     return new Integer(server.getPort());
   }
   
-  protected RegionAttributes createCacheServerAttributes()
-  {
+  protected RegionAttributes createCacheServerAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.DISTRIBUTED_ACK);
     factory.setDataPolicy(DataPolicy.REPLICATE);
     return factory.create();
   }
 
-  public void registerKeysK1andK2()
-  {
-    try {
-      Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
-      assertNotNull(r);
-      List list = new ArrayList();
-      list.add("key1");
-      list.add("key2");
-      r.registerInterest(list);
-
-    }
-    catch (Exception ex) {
-      Assert.fail("failed while registering interest", ex);
-    }
+  private void registerKeysK1andK2() {
+    Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
+    assertNotNull(r);
+    List list = new ArrayList();
+    list.add("key1");
+    list.add("key2");
+    r.registerInterest(list);
   }
 
-  public void verifySenderUpdateCount()
-  {
+  private void verifySenderUpdateCount() {
     Region r = getCache().getRegion(Region.SEPARATOR+ REGION_NAME);
     EventTrackingCacheListener listener = (EventTrackingCacheListener) r.getAttributes().getCacheListeners()[0];
 
@@ -320,8 +295,7 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
     assertEquals("Expected only 2 events for key2", 2, events.stream().filter(event -> event.getKey().equals("key2")).count());
   }
 
-  public void verifyUpdates()
-  {
+  private void verifyUpdates() {
     Awaitility.await().atMost(60, TimeUnit.SECONDS).until(() -> {
       Region r = getCache().getRegion(Region.SEPARATOR + REGION_NAME);
       // verify updates
@@ -337,21 +311,23 @@ public class UpdatePropagationDUnitTest extends JUnit4CacheTestCase {
   }
 
   private static class EventTrackingCacheListener extends CacheListenerAdapter {
+
     List<EntryEvent> receivedEvents = new ArrayList<>();
 
-    @Override public void afterCreate(final EntryEvent event) {
+    @Override
+    public void afterCreate(final EntryEvent event) {
       receivedEvents.add(event);
     }
 
-    @Override public void afterUpdate(final EntryEvent event) {
+    @Override
+    public void afterUpdate(final EntryEvent event) {
       receivedEvents.add(event);
     }
 
-    @Override public void afterDestroy(final EntryEvent event) {
+    @Override
+    public void afterDestroy(final EntryEvent event) {
       receivedEvents.add(event);
     }
-
-
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
index 589b455..45bf2b8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UpdatePropagationPRDUnitTest.java
@@ -16,17 +16,17 @@
  */
 package com.gemstone.gemfire.internal.cache.tier.sockets;
 
-import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.PartitionAttributesFactory;
+import com.gemstone.gemfire.cache.RegionAttributes;
 
 /**
  * subclass of UpdatePropagationDUnitTest to exercise partitioned regions
- *
  */
 public class UpdatePropagationPRDUnitTest extends UpdatePropagationDUnitTest {
 
   @Override
-  protected RegionAttributes createCacheServerAttributes()
-  {
+  protected RegionAttributes createCacheServerAttributes() {
     AttributesFactory factory = new AttributesFactory();
     factory.setPartitionAttributes((new PartitionAttributesFactory()).create());
     return factory.create();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
index ddcc9cb..a3a154d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
@@ -19,26 +19,18 @@
  */
 package com.gemstone.gemfire.internal.cache.wan.asyncqueue;
 
-import org.junit.After;
-import org.junit.Before;
+import static org.junit.Assert.*;
+
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.asyncqueue.AsyncEventQueueFactory;
 import com.gemstone.gemfire.cache.wan.GatewaySender.OrderPolicy;
 import com.gemstone.gemfire.internal.cache.wan.AsyncEventQueueConfigurationException;
-import com.gemstone.gemfire.internal.cache.wan.MyAsyncEventListener;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import junit.framework.TestCase;
-
-/**
- *
- */
 @Category(IntegrationTest.class)
 public class AsyncEventQueueValidationsJUnitTest {
 
@@ -59,8 +51,7 @@ public class AsyncEventQueueValidationsJUnitTest {
             .contains(" can not be created with dispatcher threads less than 1"));
     }
   }
-  
-  
+
   @Test
   public void testConcurrentParallelAsyncEventQueueAttributesOrderPolicyThread() {
     cache = new CacheFactory().set("mcast-port", "0").create();
@@ -76,6 +67,4 @@ public class AsyncEventQueueValidationsJUnitTest {
             .contains("can not be created with OrderPolicy"));
     }
   }
-  
-  
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
index f3ca340..c6206b6 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/AbstractPoolCacheJUnitTest.java
@@ -22,15 +22,14 @@
  */
 package com.gemstone.gemfire.internal.datasource;
 
+import static org.junit.Assert.*;
+
 import java.sql.Connection;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-
-import junit.framework.TestCase;
-
 import javax.naming.Context;
 import javax.sql.PooledConnection;
 import javax.sql.XAConnection;
@@ -38,19 +37,16 @@ import javax.transaction.xa.XAResource;
 
 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.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.util.test.TestUtil;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-/**
- */
 @Category(IntegrationTest.class)
 public class AbstractPoolCacheJUnitTest {
 
@@ -77,67 +73,38 @@ public class AbstractPoolCacheJUnitTest {
 
   @Test
   public void testGetSimpleDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
-          .lookup("java:/SimpleDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-          fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception thrown in testGetSimpleDataSource due to " + e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
+        .lookup("java:/SimpleDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+        fail("DataSourceFactoryTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
   }
 
   /**
-   * Test of closeActiveConnection method, of class
-   * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
-   */
-  /*
-   * @Test
-  public void testCloseActiveConnection() { try { Context ctx =
-   * cache.getJNDIContext(); GemFireConnPooledDataSource ds =
-   * (GemFireConnPooledDataSource) ctx .lookup("java:/PooledDataSource");
-   * GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-   * .getConnectionProvider(); ConnectionPoolCacheImpl poolCache =
-   * (ConnectionPoolCacheImpl) provider .getConnectionPoolCache();
-   * PooledConnection conn = poolCache.getPooledConnectionFromPool();
-   * poolCache.closeActiveConnection(conn); if
-   * (poolCache.activeCache.containsKey(conn)) fail("close active connection
-   * failed"); } catch (Exception e) { e.printStackTrace(); } }
-   */
-  /**
    * Test of returnPooledConnectionToPool method, of class
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testReturnPooledConnectionToPool() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection conn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      if (poolCache.availableCache.containsKey(conn))
-          fail("connection not removed from available cache list");
-      if (!poolCache.activeCache.containsKey(conn))
-          fail("connection not put in active connection list");
-      provider.returnConnection(conn);
-      if (!poolCache.availableCache.containsKey(conn))
-          fail("connection not returned to pool");
-      if (poolCache.activeCache.containsKey(conn))
-          fail("connection not returned to active list");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testReturnPooledConnectionToPool due to " + e);
-      e.printStackTrace();
-    }
+  public void testReturnPooledConnectionToPool() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection conn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    if (poolCache.availableCache.containsKey(conn))
+        fail("connection not removed from available cache list");
+    if (!poolCache.activeCache.containsKey(conn))
+        fail("connection not put in active connection list");
+    provider.returnConnection(conn);
+    if (!poolCache.availableCache.containsKey(conn))
+        fail("connection not returned to pool");
+    if (poolCache.activeCache.containsKey(conn))
+        fail("connection not returned to active list");
   }
 
   /**
@@ -145,26 +112,20 @@ public class AbstractPoolCacheJUnitTest {
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testValidateConnection() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection poolConn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      Connection conn = poolConn.getConnection();
-      if (!ds.validateConnection(conn)) fail("validate connection failed");
-      conn.close();
-      if (ds.validateConnection(conn)) fail("validate connection failed");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testValidateConnection due to " + e);
-      e.printStackTrace();
-    }
+  public void testValidateConnection() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection poolConn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    Connection conn = poolConn.getConnection();
+    if (!ds.validateConnection(conn)) fail("validate connection failed");
+    conn.close();
+    if (ds.validateConnection(conn)) fail("validate connection failed");
   }
 
   /**
@@ -172,28 +133,22 @@ public class AbstractPoolCacheJUnitTest {
    * com.gemstone.gemfire.internal.datasource.AbstractPoolCache.
    */
   @Test
-  public void testGetPooledConnectionFromPool() {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
-          .getConnectionProvider();
-      ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
-          .getConnectionPoolCache();
-      PooledConnection poolConn = (PooledConnection) poolCache
-          .getPooledConnectionFromPool();
-      if (poolConn == null)
-          fail("getPooledConnectionFromPool failed to get a connection from pool");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetPooledConnectionFromPool due to " + e);
-      e.printStackTrace();
-    }
+  public void testGetPooledConnectionFromPool() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    GemFireConnectionPoolManager provider = (GemFireConnectionPoolManager) ds
+        .getConnectionProvider();
+    ConnectionPoolCacheImpl poolCache = (ConnectionPoolCacheImpl) provider
+        .getConnectionPoolCache();
+    PooledConnection poolConn = (PooledConnection) poolCache
+        .getPooledConnectionFromPool();
+    if (poolConn == null)
+        fail("getPooledConnectionFromPool failed to get a connection from pool");
   }
 
   @Test
-  public void testCleanUp() {
+  public void testCleanUp() throws Exception {
     cache.close();
     ds1.disconnect();
   }
@@ -202,48 +157,41 @@ public class AbstractPoolCacheJUnitTest {
    * Tests if an XAresource obtained from an XAConnection which is already
    * closed , can return null or not.
    */
+  @Ignore("TODO: test used to eat its own exception and it fails")
   @Test
-  public void testEffectOfBlockingTimeoutOnXAConnection()
-  {
-    try {
-      Map map = new HashMap();
-      map.put("init-pool-size", "2");
-      map.put("jndi-name", "TestXAPooledDataSource");
-      map.put("max-pool-size", "7");
-      map.put("idle-timeout-seconds", "20");
-      map.put("blocking-timeout-seconds", "2");
-      map.put("login-timeout-seconds", "5");
-      //map.put("xa-datasource-class","org.apache.derby.jdbc.EmbeddedXADataSource");
-      map.put("jdbc-driver-class", "org.apache.derby.jdbc.EmbeddedDriver");
-      map.put("user-name", "mitul");
-      map.put("password", "83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a");
-      map.put("connection-url", "jdbc:derby:newDB;create=true");
-      List props = new ArrayList();
-      props
-          .add(new ConfigProperty("databaseName", "newDB", "java.lang.String"));
-
-      GemFireBasicDataSource gbds = (GemFireBasicDataSource)DataSourceFactory
-          .getSimpleDataSource(map, props);
-      map.put("xa-datasource-class",
-          "org.apache.derby.jdbc.EmbeddedXADataSource");
-
-      map.put("connection-url", "jdbc:derby:newDB;create=true");
-
-      GemFireTransactionDataSource gtds = (GemFireTransactionDataSource)DataSourceFactory
-          .getTranxDataSource(map, props);
-
-      XAConnection xaconn = (XAConnection)gtds.provider.borrowConnection();
-      try { Thread.sleep(4); } catch (InterruptedException e) { fail("interrupted"); }
-      for (int i = 0; i < 1000; ++i) {
-        XAResource xar = xaconn.getXAResource();
-        System.out.println("XAResource=" + xar);
-        assertNotNull(xar);
-      }
-
-    }
-    catch (Exception ignore) {
-      // TODO Auto-generated catch block
-
+  public void testEffectOfBlockingTimeoutOnXAConnection() throws Exception {
+    Map map = new HashMap();
+    map.put("init-pool-size", "2");
+    map.put("jndi-name", "TestXAPooledDataSource");
+    map.put("max-pool-size", "7");
+    map.put("idle-timeout-seconds", "20");
+    map.put("blocking-timeout-seconds", "2");
+    map.put("login-timeout-seconds", "5");
+    //map.put("xa-datasource-class","org.apache.derby.jdbc.EmbeddedXADataSource");
+    map.put("jdbc-driver-class", "org.apache.derby.jdbc.EmbeddedDriver");
+    map.put("user-name", "mitul");
+    map.put("password", "83f0069202c571faf1ae6c42b4ad46030e4e31c17409e19a");
+    map.put("connection-url", "jdbc:derby:newDB;create=true");
+    List props = new ArrayList();
+    props
+        .add(new ConfigProperty("databaseName", "newDB", "java.lang.String"));
+
+    GemFireBasicDataSource gbds = (GemFireBasicDataSource)DataSourceFactory
+        .getSimpleDataSource(map, props);
+    map.put("xa-datasource-class",
+        "org.apache.derby.jdbc.EmbeddedXADataSource");
+
+    map.put("connection-url", "jdbc:derby:newDB;create=true");
+
+    GemFireTransactionDataSource gtds = (GemFireTransactionDataSource)DataSourceFactory
+        .getTranxDataSource(map, props);
+
+    XAConnection xaconn = (XAConnection)gtds.provider.borrowConnection();
+    try { Thread.sleep(4); } catch (InterruptedException e) { fail("interrupted"); }
+    for (int i = 0; i < 1000; ++i) {
+      XAResource xar = xaconn.getXAResource();
+      System.out.println("XAResource=" + xar);
+      assertNotNull(xar);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
index 783cda3..9755e25 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/datasource/DataSourceFactoryJUnitTest.java
@@ -16,29 +16,23 @@
  */
 package com.gemstone.gemfire.internal.datasource;
 
+import static org.junit.Assert.*;
+
 import java.sql.Connection;
 import java.util.Properties;
-
 import javax.naming.Context;
 
-import junit.framework.TestCase;
-
 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.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.util.test.TestUtil;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
-/*
- *  
- */
 @Category(IntegrationTest.class)
 public class DataSourceFactoryJUnitTest {
 
@@ -63,52 +57,34 @@ public class DataSourceFactoryJUnitTest {
 
   @Test
   public void testGetSimpleDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
-          .lookup("java:/SimpleDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetSimpleDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireBasicDataSource ds = (GemFireBasicDataSource) ctx
+        .lookup("java:/SimpleDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetSimpleDataSource() Error in creating the GemFireBasicDataSource");
   }
 
   @Test
   public void testGetPooledDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
-          .lookup("java:/PooledDataSource");
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetPooledDataSource() Error in creating the GemFireConnPooledDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetPooledDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireConnPooledDataSource ds = (GemFireConnPooledDataSource) ctx
+        .lookup("java:/PooledDataSource");
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetPooledDataSource() Error in creating the GemFireConnPooledDataSource");
   }
 
   @Test
   public void testGetTranxDataSource() throws Exception {
-    try {
-      Context ctx = cache.getJNDIContext();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      //DataSourceFactory dsf = new DataSourceFactory();
-      //GemFireTransactionDataSource ds =
-      // (GemFireTransactionDataSource)dsf.getTranxDataSource(map);
-      Connection conn = ds.getConnection();
-      if (conn == null)
-        fail("DataSourceFactoryJUnitTest-testGetTranxDataSource() Error in creating the getTranxDataSource");
-    }
-    catch (Exception e) {
-      fail("Exception occured in testGetTranxDataSource due to "+e);
-      e.printStackTrace();
-    }
+    Context ctx = cache.getJNDIContext();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    //DataSourceFactory dsf = new DataSourceFactory();
+    //GemFireTransactionDataSource ds =
+    // (GemFireTransactionDataSource)dsf.getTranxDataSource(map);
+    Connection conn = ds.getConnection();
+    if (conn == null)
+      fail("DataSourceFactoryJUnitTest-testGetTranxDataSource() Error in creating the getTranxDataSource");
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
index 4ff2896..c73b5e8 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/ExceptionJUnitTest.java
@@ -19,10 +19,11 @@ package com.gemstone.gemfire.internal.jta;
 import static org.junit.Assert.*;
 
 import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import javax.transaction.*;
+import javax.transaction.NotSupportedException;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.UserTransaction;
 
 import org.junit.After;
 import org.junit.AfterClass;
@@ -37,7 +38,6 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
 /**
  * Check if the correct expectations are being thrown when they are supposed to.
- * 
  */
 @Category(IntegrationTest.class)
 public class ExceptionJUnitTest {
@@ -67,10 +67,6 @@ public class ExceptionJUnitTest {
     utx = new UserTransactionImpl();
   }
 
-  @After
-  public void tearDown() {
-  }
-
   @Test
   public void testNestedTransactionNotSupported() throws Exception {
     try {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
index a3c47e5..52c8a47 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/GlobalTransactionJUnitTest.java
@@ -16,20 +16,22 @@
  */
 package com.gemstone.gemfire.internal.jta;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.*;
 
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.Properties;
-
 import javax.naming.Context;
 import javax.transaction.RollbackException;
+import javax.transaction.Status;
 import javax.transaction.Synchronization;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
-import javax.transaction.Status;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -38,12 +40,11 @@ import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.datasource.GemFireBasicDataSource;
 import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
-import com.gemstone.gemfire.internal.datasource.RestartJUnitTest;
-import com.gemstone.gemfire.util.test.TestUtil;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.util.test.TestUtil;
 
 @Category(IntegrationTest.class)
-public class GlobalTransactionJUnitTest extends TestCase {
+public class GlobalTransactionJUnitTest {
 
   private static Properties props = null;
   private static DistributedSystem ds1 = null;
@@ -51,8 +52,8 @@ public class GlobalTransactionJUnitTest extends TestCase {
   private static UserTransaction utx = null;
   private static TransactionManager tm = null;
 
-  @Override
-  protected void setUp() throws Exception {
+  @Before
+  public void setUp() throws Exception {
     props = new Properties();
     props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
     String path = TestUtil.getResourcePath(GlobalTransactionJUnitTest.class, "/jta/cachejta.xml");
@@ -63,15 +64,12 @@ public class GlobalTransactionJUnitTest extends TestCase {
     tm = TransactionManagerImpl.getTransactionManager();
   }
 
-  @Override
-  protected void tearDown() throws Exception {
+  @After
+  public void tearDown() throws Exception {
     ds1.disconnect();
   }
 
-  public GlobalTransactionJUnitTest(String name) {
-    super(name);
-  }
-
+  @Test
   public void testGetSimpleDataSource() throws Exception {
     try {
       Context ctx = cache.getJNDIContext();
@@ -87,6 +85,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testSetRollbackOnly() {
     try {
       utx.begin();
@@ -104,6 +103,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testEnlistResource() {
     try {
       boolean exceptionoccured = false;
@@ -133,6 +133,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testRegisterSynchronization() {
     try {
       boolean exceptionoccured = false;
@@ -161,6 +162,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testEnlistResourceAfterRollBack() {
     try {
       boolean exceptionoccured = false;
@@ -191,6 +193,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testRegisterSynchronizationAfterRollBack() {
     try {
       boolean exceptionoccured = false;
@@ -221,6 +224,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testSuspend() {
     try {
       utx.begin();
@@ -236,6 +240,7 @@ public class GlobalTransactionJUnitTest extends TestCase {
     }
   }
 
+  @Test
   public void testResume() {
     try {
       utx.begin();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
index 6148bef..7472a98 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/jta/TransactionTimeOutJUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.jta;
 
+import static org.junit.Assert.*;
+
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -25,7 +27,6 @@ import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.sql.Connection;
 import java.sql.ResultSet;
-//import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
 import java.util.Random;
@@ -34,10 +35,13 @@ import javax.naming.Context;
 import javax.sql.DataSource;
 import javax.transaction.UserTransaction;
 
-import junit.framework.TestCase;
-
+import org.junit.After;
+import org.junit.Before;
 import org.junit.FixMethodOrder;
+import org.junit.Rule;
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 import org.junit.runners.MethodSorters;
 
 import com.gemstone.gemfire.cache.Cache;
@@ -47,271 +51,228 @@ import com.gemstone.gemfire.internal.datasource.GemFireTransactionDataSource;
 import com.gemstone.gemfire.util.test.TestUtil;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+/**
+ * TODO: this test has no assertions or validations of any sort
+ */
 @Category(IntegrationTest.class)
-public class TransactionTimeOutJUnitTest extends TestCase {
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TransactionTimeOutJUnitTest {
 
-  private static Properties props = null;
   private static DistributedSystem ds1 = null;
   private static Cache cache = null;
 
-  protected void setUp() throws Exception {
-    super.setUp();
-    props = new Properties();
+  @Rule
+  public TestName testName = new TestName();
+
+  @Before
+  public void setUp() throws Exception {
+    Properties props = new Properties();
     props.setProperty("mcast-port", "0");
+
     int pid = new Random().nextInt();
+
     File tmpFile = File.createTempFile("dunit-cachejta_", ".xml");
     tmpFile.deleteOnExit();
+
     String path = tmpFile.getAbsolutePath();
     String file_as_str = readFile(TestUtil.getResourcePath(TransactionTimeOutJUnitTest.class, "/jta/cachejta.xml"));
     String modified_file_str= file_as_str.replaceAll("newDB", "newDB_" + pid);
+
     FileOutputStream fos = new FileOutputStream(path);
     BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(fos));
     wr.write(modified_file_str);
     wr.flush();
     wr.close();
+
     props.setProperty("cache-xml-file", path);
-    // props.setProperty("cache-xml-file","D:\\projects\\JTA\\cachejta.xml");
+
     ds1 = DistributedSystem.connect(props);
     cache = CacheFactory.create(ds1);
-    cache.getLogger().fine("SWAP:running test:"+getName());
+    cache.getLogger().fine("SWAP:running test:" + testName.getMethodName());
   }
 
-  protected void tearDown() throws Exception {
-    super.tearDown();
+  @After
+  public void tearDown() throws Exception {
     ds1.disconnect();
+    // TODO: null out the statics!
   }
 
-  public TransactionTimeOutJUnitTest(String arg0) {
-    super(arg0);
+  @Test
+  public void test1One() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    Thread.sleep(2000);
+    utx.setTransactionTimeout(2);
+    utx.setTransactionTimeout(200);
+    utx.setTransactionTimeout(3);
+    Thread.sleep(5000);
+    //utx.commit();
   }
 
-  public void test1One() {
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      Thread.sleep(2000);
-      utx.setTransactionTimeout(2);
-      utx.setTransactionTimeout(200);
-      utx.setTransactionTimeout(3);
-      Thread.sleep(5000);
-      //utx.commit();
-    } catch (Exception e) {
-      fail("Exception in TestSetTransactionTimeOut due to " + e);
-    }
+  @Test
+  public void test2SetTransactionTimeOut() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    utx.setTransactionTimeout(2);
+    System.out.println("Going to sleep");
+    Thread.sleep(6000);
+    utx.begin();
+    utx.commit();
   }
 
-  public void test2SetTransactionTimeOut() {
+  @Test
+  public void test3ExceptionOnCommitAfterTimeOut() throws Exception {
+    UserTransaction utx;
+    utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(2);
+    utx.begin();
+    Thread.sleep(4000);
     try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      utx.setTransactionTimeout(2);
-      System.out.println("Going to sleep");
-      Thread.sleep(6000);
-      utx.begin();
       utx.commit();
-    } catch (Exception e) {
-      fail("Exception in TestSetTransactionTimeOut due to " + e);
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test3ExceptionOnCommitAfterTimeOut() {
+  @Test
+  public void test4MultipleSetTimeOuts() throws Exception {
     UserTransaction utx;
-    boolean exceptionOccured = true;
+    utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(10);
+    utx.begin();
+    utx.setTransactionTimeout(8);
+    utx.setTransactionTimeout(6);
+    utx.setTransactionTimeout(2);
+    Thread.sleep(6000);
     try {
-      utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(2);
-      utx.begin();
-      Thread.sleep(4000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      utx.commit();
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test4MultipleSetTimeOuts() {
-    UserTransaction utx;
-    boolean exceptionOccured = true;
+  @Test
+  public void test5TimeOutBeforeBegin() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.setTransactionTimeout(4);
+    utx.begin();
+    Thread.sleep(6000);
     try {
-      utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(10);
-      utx.begin();
-      utx.setTransactionTimeout(8);
-      utx.setTransactionTimeout(6);
-      utx.setTransactionTimeout(2);
-      Thread.sleep(6000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+      utx.commit();
+      fail("TimeOut did not rollback the transaction");
+    } catch (Exception expected) {
     }
   }
 
-  public void test5TimeOutBeforeBegin() {
-    boolean exceptionOccured = true;
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.setTransactionTimeout(4);
-      utx.begin();
-      Thread.sleep(6000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = false;
-      }
-      if (exceptionOccured) {
-        fail("TimeOut did not rollback the transaction");
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
-    }
+  @Test
+  public void test6CommitBeforeTimeOut() throws Exception {
+    UserTransaction utx = new UserTransactionImpl();
+    utx.begin();
+    utx.setTransactionTimeout(6);
+    Thread.sleep(2000);
+    utx.commit();
   }
 
-  public void test6CommitBeforeTimeOut() {
-//    boolean exceptionOccured = true;
-    try {
-      UserTransaction utx = new UserTransactionImpl();
-      utx.begin();
-      utx.setTransactionTimeout(6);
-      Thread.sleep(2000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        fail("Transaction failed to commit although TimeOut was not exceeded due to "
-            + e);
-      }
-    } catch (Exception e) {
-      fail("Exception in testExceptionOnCommitAfterTimeOut() due to " + e);
+  @Test
+  public void test7Commit() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable1 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    Thread.sleep(5000);
+    utx.setTransactionTimeout(20);
+    utx.setTransactionTimeout(10);
+    sql = "insert into newTable1  values (1)";
+    sm.execute(sql);
+    utx.commit();
+    sql = "select * from newTable1 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
     }
+    sql = "drop table newTable1";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
   }
 
-  public void test7Commit() {
+  @Test
+  public void test8CommitAfterTimeOut() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable2 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    sql = "insert into newTable2  values (1)";
+    sm.execute(sql);
+    sql = "select * from newTable2 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
+    }
+    sql = "drop table newTable2";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
+    utx.setTransactionTimeout(1);
+    Thread.sleep(3000);
     try {
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable1 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      Thread.sleep(5000);
-      utx.setTransactionTimeout(20);
-      utx.setTransactionTimeout(10);
-      sql = "insert into newTable1  values (1)";
-      sm.execute(sql);
       utx.commit();
-      sql = "select * from newTable1 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable1";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-    } catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+      fail("exception did not occur on commit although transaction timed out");
+    } catch (Exception expected) {
     }
   }
 
-  public void test8CommitAfterTimeOut() {
-    try {
-      boolean exceptionOccured = false;
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable2 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      sql = "insert into newTable2  values (1)";
-      sm.execute(sql);
-      sql = "select * from newTable2 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable2";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-      utx.setTransactionTimeout(1);
-      Thread.sleep(3000);
-      try {
-        utx.commit();
-      } catch (Exception e) {
-        exceptionOccured = true;
-      }
-      if (!exceptionOccured) {
-        fail("exception did not occur on commit although transaction timed out");
-      }
-    } catch (Exception e) {
-      fail("Exception occured in test Commit due to " + e);
-      e.printStackTrace();
+  @Test
+  public void test9RollbackAfterTimeOut() throws Exception {
+    Context ctx = cache.getJNDIContext();
+    DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
+    Connection conn2 = ds2.getConnection();
+    GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
+        .lookup("java:/XAPooledDataSource");
+    UserTransaction utx = (UserTransaction) ctx
+        .lookup("java:/UserTransaction");
+    utx.begin();
+    Connection conn = ds.getConnection();
+    String sql = "create table newTable3 (id integer)";
+    Statement sm = conn.createStatement();
+    sm.execute(sql);
+    utx.setTransactionTimeout(30);
+    sql = "insert into newTable3  values (1)";
+    sm.execute(sql);
+    sql = "select * from newTable3 where id = 1";
+    ResultSet rs = sm.executeQuery(sql);
+    if (!rs.next()) {
+      fail("Transaction not committed");
     }
-  }
-
-  public void test9RollbackAfterTimeOut() {
+    sql = "drop table newTable3";
+    sm.execute(sql);
+    sm.close();
+    conn.close();
+    conn2.close();
+    utx.setTransactionTimeout(1);
+    Thread.sleep(3000);
     try {
-      boolean exceptionOccured = false;
-      Context ctx = cache.getJNDIContext();
-      DataSource ds2 = (DataSource) ctx.lookup("java:/SimpleDataSource");
-      Connection conn2 = ds2.getConnection();
-      GemFireTransactionDataSource ds = (GemFireTransactionDataSource) ctx
-          .lookup("java:/XAPooledDataSource");
-      UserTransaction utx = (UserTransaction) ctx
-          .lookup("java:/UserTransaction");
-      utx.begin();
-      Connection conn = ds.getConnection();
-      String sql = "create table newTable3 (id integer)";
-      Statement sm = conn.createStatement();
-      sm.execute(sql);
-      utx.setTransactionTimeout(30);
-      sql = "insert into newTable3  values (1)";
-      sm.execute(sql);
-      sql = "select * from newTable3 where id = 1";
-      ResultSet rs = sm.executeQuery(sql);
-      if (!rs.next()) fail("Transaction not committed");
-      sql = "drop table newTable3";
-      sm.execute(sql);
-      sm.close();
-      conn.close();
-      conn2.close();
-      utx.setTransactionTimeout(1);
-      Thread.sleep(3000);
-      try {
-        utx.rollback();
-      } catch (Exception e) {
-        exceptionOccured = true;
-      }
-      if (!exceptionOccured) {
-        fail("exception did not occur on rollback although transaction timed out");
-      }
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail("Exception occured in test Commit due to " + e);
+      utx.rollback();
+      fail("exception did not occur on rollback although transaction timed out");
+    } catch (Exception expected) {
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
index df9e5b6..70668e1 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/LocatorLogFileJUnitTest.java
@@ -16,20 +16,18 @@
  */
 package com.gemstone.gemfire.internal.logging;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.util.Properties;
 
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
 
-import static org.junit.Assert.*;
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.distributed.Locator;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
@@ -45,15 +43,16 @@ import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
  */
 @Category(IntegrationTest.class)
 public class LocatorLogFileJUnitTest {
-  @Rule public TestName name = new TestName();
 
   protected static final int TIMEOUT_MILLISECONDS = 180 * 1000; // 2 minutes
   protected static final int INTERVAL_MILLISECONDS = 100; // 100 milliseconds
   
   private Locator locator;
   private FileInputStream fis;
-  
-  
+
+  @Rule
+  public TestName name = new TestName();
+
   @After
   public void tearDown() throws Exception {
     if (this.locator != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
index 52a5dfd..25a883e 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/statistics/ValueMonitorJUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.statistics;
 
+import static org.junit.Assert.*;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -31,8 +33,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.*;
-
 import com.gemstone.gemfire.StatisticDescriptor;
 import com.gemstone.gemfire.Statistics;
 import com.gemstone.gemfire.StatisticsType;
@@ -43,8 +43,6 @@ import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.dunit.WaitCriterion;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-import junit.framework.TestCase;
-
 /**
  * Integration test for the SampleCollector class.
  *   
@@ -55,7 +53,6 @@ public class ValueMonitorJUnitTest {
 
   private Mockery mockContext;
   
-  
   @Before
   public void setUp() throws Exception {
     this.mockContext = new Mockery() {{
@@ -300,8 +297,7 @@ public class ValueMonitorJUnitTest {
     assertEquals(1, statCount);
   }
   
-  protected StatisticId createStatisticId(
-      final StatisticDescriptor descriptor, final Statistics stats) {
+  private StatisticId createStatisticId(final StatisticDescriptor descriptor, final Statistics stats) {
     return new StatisticId() {
 
       @Override
@@ -317,8 +313,7 @@ public class ValueMonitorJUnitTest {
     };
   }
   
-  protected StatisticsNotification createStatisticsNotification(
-      final long timeStamp, final Type type, final Number value) {
+  protected StatisticsNotification createStatisticsNotification(final long timeStamp, final Type type, final Number value) {
     return new StatisticsNotification() {
 
       @Override
@@ -333,22 +328,22 @@ public class ValueMonitorJUnitTest {
 
       @Override
       public Iterator<StatisticId> iterator() {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(StatisticDescriptor statDesc) {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(Statistics statistics) {
-        return null; // TODO
+        return null;
       }
 
       @Override
       public Iterator<StatisticId> iterator(StatisticsType statisticsType) {
-        return null; // TODO
+        return null;
       }
 
       @Override
@@ -361,9 +356,11 @@ public class ValueMonitorJUnitTest {
   
   private static void waitForNotification(final List<StatisticsNotification> notifications, long ms, long interval, boolean throwOnTimeout) {
     WaitCriterion wc = new WaitCriterion() {
+      @Override
       public boolean done() {
         return notifications.size() > 0;
       }
+      @Override
       public String description() {
         return "waiting for notification";
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7e9d4a62/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
index e4489d4..079db17 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ConcurrentHashMapIteratorJUnitTest.java
@@ -16,6 +16,8 @@
  */
 package com.gemstone.gemfire.internal.util.concurrent;
 
+import static org.junit.Assert.*;
+
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -23,17 +25,17 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.concurrent.ConcurrentMap;
 
+import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import junit.framework.TestCase;
-
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
-@SuppressWarnings({ "rawtypes", "unchecked" })
 @Category(IntegrationTest.class)
-public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class ConcurrentHashMapIteratorJUnitTest {
 
+  @Test
   public void test() throws InterruptedException {
     
     //Apparently, we need a distributed system to create
@@ -75,16 +77,16 @@ public class ConcurrentHashMapIteratorJUnitTest extends TestCase {
       fail("On run " + i + " did not find these elements of the initial set using the iterator " + missed);
     }
   }
-  
-  public void createBaseline(ConcurrentMap baselineMap, ConcurrentMap testMap, 
+
+  private void createBaseline(ConcurrentMap baselineMap, ConcurrentMap testMap,
       int start, int end) {
     for(int i = start; i < end; i++) {
       baselineMap.put(i, i);
       testMap.put(i, i);
     }
   }
-  
-  public static class RandomMutations extends Thread {
+
+  private static class RandomMutations extends Thread {
     private final ConcurrentMap baselineMap;
     private final ConcurrentMap testMap;
     private int start;