geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: Revert "GEODE-1146: Amending Testcase to use proper client caches rather than peer servers. Also amending JUnit4CacheTestCase.java to set "locators" and "mcast-port" to correct settings for clients."
Date Fri, 13 May 2016 17:15:37 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f59497776 -> 7051c7ad6


Revert "GEODE-1146: Amending Testcase to use proper client caches rather than peer servers.
Also amending JUnit4CacheTestCase.java to set "locators" and "mcast-port" to correct settings
for clients."

This reverts commit 2c2caae9db8d687107d5d15af44a5f0d14465b35, which caused
a number of tests to fail.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/7051c7ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/7051c7ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/7051c7ad

Branch: refs/heads/develop
Commit: 7051c7ad61ef1c41db192c62277ff2dc0f332842
Parents: f594977
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Fri May 13 10:03:51 2016 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Fri May 13 10:03:51 2016 -0700

----------------------------------------------------------------------
 .../query/dunit/QueryUsingPoolDUnitTest.java    | 192 ++++++++++++-------
 .../cache/internal/JUnit4CacheTestCase.java     |  17 +-
 2 files changed, 136 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7051c7ad/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
index 0e25d05..a87c243 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java
@@ -18,11 +18,11 @@ package com.gemstone.gemfire.cache.query.dunit;
 
 import cacheRunner.Portfolio;
 import cacheRunner.Position;
+import org.junit.experimental.categories.Category;
+
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.*;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.query.*;
@@ -35,11 +35,16 @@ import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.ClientServerTestCase;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheClientNotifier;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.dunit.Assert;
+import com.gemstone.gemfire.test.dunit.DistributedTestUtils;
+import com.gemstone.gemfire.test.dunit.Host;
+import com.gemstone.gemfire.test.dunit.IgnoredException;
+import com.gemstone.gemfire.test.dunit.LogWriterUtils;
+import com.gemstone.gemfire.test.dunit.NetworkUtils;
+import com.gemstone.gemfire.test.dunit.SerializableRunnable;
+import com.gemstone.gemfire.test.dunit.VM;
+import com.gemstone.gemfire.test.dunit.Wait;
 import com.gemstone.gemfire.test.junit.categories.FlakyTest;
-import com.jayway.awaitility.Awaitility;
-import org.junit.experimental.categories.Category;
 
 import java.io.DataInput;
 import java.io.DataOutput;
@@ -48,7 +53,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.Properties;
 import java.util.Set;
-import java.util.concurrent.TimeUnit;
 
 /**
  * Tests remote (client/server) query execution.
@@ -110,24 +114,29 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   public void createPool(final String poolName, final String[] servers, final int[] ports,
       final boolean subscriptionEnabled) {
     // Create Cache.
-    getCache(true);
+    getCache();
 
-    PoolFactory poolFactory = PoolManager.createFactory();
-    poolFactory.setSubscriptionEnabled(subscriptionEnabled);
+    PoolFactory cpf = PoolManager.createFactory();
+    cpf.setSubscriptionEnabled(subscriptionEnabled);
     for (int i = 0; i < servers.length; i++) {
-      LogService.getLogger().info("### Adding to Pool. ### Server : " + servers[i] + " Port
: " + ports[i]);
-      poolFactory.addServer(servers[i], ports[i]);
+      LogWriterUtils.getLogWriter().info("### Adding to Pool. ### Server : " + servers[i]
+ " Port : " + ports[i]);
+      cpf.addServer(servers[i], ports[i]);
     }
-    poolFactory.setMinConnections(1);
-    poolFactory.setMaxConnections(5);
-    poolFactory.setRetryAttempts(5);
-    poolFactory.create(poolName);
+
+    cpf.create(poolName);
   }
 
   public void validateCompiledQuery(final long compiledQueryCount) {
-    Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS)
-        .pollDelay(100, TimeUnit.MILLISECONDS).timeout(60, TimeUnit.SECONDS)
-        .until(() -> CacheClientNotifier.getInstance().getStats().getCompiledQueryCount()
== compiledQueryCount);
+    long count = 0;
+    for (int i = 0; i < 100; i++) {
+      count = CacheClientNotifier.getInstance().getStats().getCompiledQueryCount();
+      if (count == compiledQueryCount) {
+        break;
+      } else {
+        Wait.pause(1 * 100);
+      }
+    }
+    assertEquals(compiledQueryCount, count);
   }
 
   /**
@@ -151,7 +160,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, rootRegionName, factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -277,7 +286,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -404,7 +413,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -587,6 +596,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, factory.create());
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -790,7 +800,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
         for (int i = 0; i < queryString.length; i++) {
           try {
-            LogService.getLogger().info("### Executing Query :" + queryString[i]);
+            LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
             Query query = qService.newQuery(queryString[i]);
             results = (SelectResults) query.execute(params[i]);
           } catch (Exception e) {
@@ -820,7 +830,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       for (int x = 0; x < useMaintainedCompiledQueries; x++) {
         for (int i = 0; i < queryString.length; i++) {
           try {
-            LogService.getLogger().info("### Executing Query :" + queryString[i]);
+            LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
             Query query = qService.newQuery(queryString[i]);
             results = (SelectResults) query.execute(params[i]);
           } catch (Exception e) {
@@ -901,8 +911,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     });
 
     // Create client region
-    final int port0 = vm0.invoke("getCacheServerPort", () -> getCacheServerPort());
-    final int port1 = vm1.invoke("getCacheServerPort", () -> getCacheServerPort());
+    final int port0 = vm0.invoke("getCacheServerPort", () -> QueryUsingPoolDUnitTest.getCacheServerPort());
+    final int port1 = vm1.invoke("getCacheServerPort", () -> QueryUsingPoolDUnitTest.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 
@@ -925,7 +935,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         for (int j = 0; j < queryString.length; j++) {
           for (int i = 0; i < queryString.length; i++) {
             try {
-              LogService.getLogger().info("### Executing Query :" + queryString[i]);
+              LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
               Query query = qService.newQuery(queryString[i]);
               results = (SelectResults) query.execute(params[i]);
             } catch (Exception e) {
@@ -968,8 +978,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     });
 
     // recreate clients and execute queries.
-    vm2.invoke("createPool", () -> createPool(poolName, new String[] { host0, host0 },
new int[] { port1, port0 }, true));
-    vm3.invoke("createPool", () -> createPool(poolName, new String[] { host0, host0 },
new int[] { port0, port1 }, true));
+    vm2.invoke("createPool", () -> createPool(poolName, new String[] { host0,host0 },
new int[] { port1, port0 }, true));
+    vm3.invoke("createPool", () -> createPool(poolName, new String[] { host0,host0 },
new int[] { port0, port1 }, true));
 
     vm2.invoke(executeQueries);
     vm3.invoke(executeQueries);
@@ -1124,10 +1134,14 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     // Validate maintained compiled queries.
     vm0.invoke("validate Compiled query", () -> validateCompiledQuery(queryString.length));
 
+    // Let the compiled queries to be idle (not used).
+    Wait.pause(2 * 1000);
+
     // Validate maintained compiled queries.
     vm0.invoke("validate Compiled query", () -> validateCompiledQuery(0));
 
     // Close clients
+
     vm1.invoke("closeClient", () -> closeClient());
     vm2.invoke("closeClient", () -> closeClient());
 
@@ -1247,6 +1261,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
   @Category(FlakyTest.class) // GEODE-1146: time senstiive, thread sleeps, uses zero port
for servers (good!), async actions, AsyncInvocation orphans
   public void testBindParamsWithMulitipleClients() throws CacheException {
 
+    final String name = this.getName();
+
     final Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
     VM vm1 = host.getVM(1);
@@ -1282,7 +1298,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     });
 
     // Create client region
-    final int port0 = vm0.invoke("getCacheServerPort", () -> getCacheServerPort());
+    final int port0 = vm0.invoke("getCacheServerPort", () -> QueryUsingPoolDUnitTest.getCacheServerPort());
 
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 
@@ -1308,7 +1324,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         for (int j = 0; j < 5; j++) {
           for (int i = 0; i < 2; i++) {
             try {
-              LogService.getLogger().info("### Executing Query :" + queryString[i]);
+              LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
               Query query = qService.newQuery(queryString[i]);
               rs[0][0] = (SelectResults) query.execute(params[i]);
               Query query2 = qService.newQuery(querys[i]);
@@ -1317,17 +1333,37 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
             } catch (Exception e) {
               Assert.fail("Failed executing " + queryString[i], e);
             }
-            LogService.getLogger().info("### Comparing results for Query :" + ((i + 1) *
(j + 1)) + " : " + queryString[i]);
+            LogWriterUtils.getLogWriter().info("### Comparing results for Query :" + ((i
+ 1) * (j + 1)) + " : " + queryString[i]);
             compareQueryResultsWithoutAndWithIndexes(rs, 1);
-            LogService.getLogger().info("### Done Comparing results for Query :" + ((i +
1) * (j + 1)) + " : " + queryString[i]);
+            LogWriterUtils.getLogWriter().info("### Done Comparing results for Query :" +
((i + 1) * (j + 1)) + " : " + queryString[i]);
           }
         }
       }
     };
 
-    vm1.invoke("executeSameQueries", () -> executeSameQueries);
-    vm2.invoke("executeSameQueries", () -> executeSameQueries);
-    vm3.invoke("executeSameQueries", () -> executeSameQueries);
+    vm1.invokeAsync(executeSameQueries);
+    vm2.invokeAsync(executeSameQueries);
+    vm3.invokeAsync(executeSameQueries);
+
+    // Wait till the query execution completes.
+    vm0.invoke("validate compiled query.", () -> {
+      long compiledQueryUsedCount = -1;
+      while (true) {
+        LogWriterUtils.getLogWriter().info("### CompiledQueryUsedCount :" + compiledQueryUsedCount);
+        if (compiledQueryUsedCount == CacheClientNotifier.getInstance().getStats().getCompiledQueryUsedCount())
{
+          LogWriterUtils.getLogWriter().info("### previous and current CompiledQueryUsedCounts
are same :" + compiledQueryUsedCount);
+          break;
+        } else {
+          compiledQueryUsedCount = CacheClientNotifier.getInstance().getStats().getCompiledQueryUsedCount();
+          try {
+            Thread.currentThread().sleep(3 * 1000);
+          } catch (Exception ex) {
+            break;
+          }
+        }
+      }
+      return 0;
+    });
 
     // Execute client queries and validate results.
     SerializableRunnable executeQueries = new CacheSerializableRunnable("Execute queries")
{
@@ -1343,7 +1379,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         for (int j = 0; j < queryString.length; j++) {
           for (int i = 0; i < queryString.length; i++) {
             try {
-              LogService.getLogger().info("### Executing Query :" + queryString[i]);
+              LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
               Query query = qService.newQuery(queryString[i]);
               rs[0][0] = (SelectResults) query.execute(params[i]);
               Query query2 = qService.newQuery(querys[i]);
@@ -1358,9 +1394,29 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       }
     };
 
-    vm1.invoke("executeQueries", () -> executeQueries);
-    vm2.invoke("executeQueries", () -> executeQueries);
-    vm3.invoke("executeQueries", () -> executeQueries);
+    vm1.invokeAsync("executeQueries", () -> executeQueries);
+    vm2.invokeAsync("executeQueries", () -> executeQueries);
+    vm3.invokeAsync("executeQueries", () -> executeQueries);
+
+    // Wait till the query execution completes.
+    vm0.invoke("validate compiled query.", () -> {
+      long compiledQueryUsedCount = -1;
+      while (true) {
+        LogWriterUtils.getLogWriter().info("### previous CompiledQueryUsedCount :" + compiledQueryUsedCount);
+        if (compiledQueryUsedCount == CacheClientNotifier.getInstance().getStats().getCompiledQueryUsedCount())
{
+          LogWriterUtils.getLogWriter().info("### previous and current CompiledQueryUsedCounts
are same :" + compiledQueryUsedCount);
+          break;
+        } else {
+          compiledQueryUsedCount = CacheClientNotifier.getInstance().getStats().getCompiledQueryUsedCount();
+          try {
+            Thread.currentThread().sleep(3 * 1000);
+          } catch (Exception ex) {
+            break;
+          }
+        }
+      }
+      return 0;
+    });
 
     vm1.invoke("closeClient", () -> closeClient());
     vm2.invoke("closeClient", () -> closeClient());
@@ -1392,7 +1448,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       factory.setScope(Scope.LOCAL);
       createRegion(name + "1", factory.create());
       createRegion(name + "2", factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -1484,7 +1540,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -1500,7 +1556,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       }
     });
 
-    final int port = vm0.invoke("getCacheServerPort", () -> getCacheServerPort());
+    final int port = vm0.invoke("getCacheServerPort", () -> QueryUsingPoolDUnitTest.getCacheServerPort());
     final String host0 = NetworkUtils.getServerHostName(vm0.getHost());
 
     final String regionName = "/" + rootRegionName + "/" + name;
@@ -1607,7 +1663,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       Properties config = new Properties();
       config.setProperty("locators", "localhost[" + DistributedTestUtils.getDUnitLocatorPort()
+ "]");
       getSystem(config);
-      //      Wait.pause(1000);
+
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -1627,7 +1684,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
         }
 
       });
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       for (int i = 0; i < numberOfEntries; i++) {
         region1.put("key-" + i, new TestObject(i, "ibm"));
         region2.put("key-" + i, new TestObject(i, "ibm"));
@@ -1693,7 +1750,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.LOCAL);
       createRegion(name, factory.create());
-      //      Wait.pause(1000);
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -1835,7 +1892,8 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       Properties config = new Properties();
       config.setProperty("locators", "localhost[" + DistributedTestUtils.getDUnitLocatorPort()
+ "]");
       getSystem(config);
-      //      Wait.pause(1000);
+
+      Wait.pause(1000);
       try {
         startBridgeServer(0, false);
       } catch (Exception ex) {
@@ -1865,7 +1923,9 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
     // Execute client queries in VM1      
     vm1.invoke("Execute queries", () -> {
-      final Region region1 = ((ClientCache) getCache()).createClientRegionFactory(ClientRegionShortcut.LOCAL).create(name);
+      AttributesFactory factory = new AttributesFactory();
+      factory.setScope(Scope.LOCAL);
+      final Region region1 = createRegion(name, factory.createRegionAttributes());
 
       String queryString = "select distinct * from " + regionName1 + " where ticker = $1";
       Object[] params = new Object[] { new String("ibm") };
@@ -1966,15 +2026,15 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       type1 = ((SelectResults) r[j][0]).getCollectionType().getElementType();
       type2 = ((SelectResults) r[j][1]).getCollectionType().getElementType();
       if ((type1.getClass().getName()).equals(type2.getClass().getName())) {
-        LogService.getLogger().info("Both SelectResults are of the same Type i.e.--> "
+        LogWriterUtils.getLogWriter().info("Both SelectResults are of the same Type i.e.-->
"
             + ((SelectResults) r[j][0]).getCollectionType().getElementType());
       } else {
-        LogService.getLogger().info("Classes are : " + type1.getClass().getName() + " "
+        LogWriterUtils.getLogWriter().info("Classes are : " + type1.getClass().getName()
+ " "
             + type2.getClass().getName());
         fail("FAILED:Select result Type is different in both the cases");
       }
       if (((SelectResults) r[j][0]).size() == ((SelectResults) r[j][1]).size()) {
-        LogService.getLogger().info("Both SelectResults are of Same Size i.e.  Size= "
+        LogWriterUtils.getLogWriter().info("Both SelectResults are of Same Size i.e.  Size=
"
             + ((SelectResults) r[j][1]).size());
       } else {
         fail("FAILED:SelectResults size is different in both the cases. Size1="
@@ -1984,7 +2044,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
       set2 = (((SelectResults) r[j][1]).asSet());
       set1 = (((SelectResults) r[j][0]).asSet());
 
-      LogService.getLogger().info(" SIZE1 = " + set1.size() + " SIZE2 = " + set2.size());
+      LogWriterUtils.getLogWriter().info(" SIZE1 = " + set1.size() + " SIZE2 = " + set2.size());
 
       //      boolean pass = true;
       itert1 = set1.iterator();
@@ -1994,10 +2054,10 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
         boolean exactMatch = false;
         while (itert2.hasNext()) {
-          LogService.getLogger().info("### Comparing results..");
+          LogWriterUtils.getLogWriter().info("### Comparing results..");
           Object p2 = itert2.next();
           if (p1 instanceof Struct) {
-            LogService.getLogger().info("ITS a Set");
+            LogWriterUtils.getLogWriter().info("ITS a Set");
             Object[] values1 = ((Struct) p1).getFieldValues();
             Object[] values2 = ((Struct) p2).getFieldValues();
             assertEquals(values1.length, values2.length);
@@ -2009,26 +2069,26 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
             }
             exactMatch = elementEqual;
           } else {
-            LogService.getLogger().info("Not a Set p2:" + p2 + " p1: " + p1);
+            LogWriterUtils.getLogWriter().info("Not a Set p2:" + p2 + " p1: " + p1);
             if (p2 instanceof TestObject) {
-              LogService.getLogger().info("An instance of TestObject");
+              LogWriterUtils.getLogWriter().info("An instance of TestObject");
               exactMatch = p2.equals(p1);
             } else {
-              LogService.getLogger().info("Not an instance of TestObject" + p2.getClass().getCanonicalName());
+              LogWriterUtils.getLogWriter().info("Not an instance of TestObject" + p2.getClass().getCanonicalName());
               exactMatch = p2.equals(p1);
             }
           }
           if (exactMatch) {
-            LogService.getLogger().info("Exact MATCH");
+            LogWriterUtils.getLogWriter().info("Exact MATCH");
             break;
           }
         }
         if (!exactMatch) {
-          LogService.getLogger().info("NOT A MATCH");
+          LogWriterUtils.getLogWriter().info("NOT A MATCH");
           fail("Atleast one element in the pair of SelectResults supposedly identical, is
not equal ");
         }
       }
-      LogService.getLogger().info("### Done Comparing results..");
+      LogWriterUtils.getLogWriter().info("### Done Comparing results..");
     }
   }
 
@@ -2039,7 +2099,7 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
     AttributesFactory factory = new AttributesFactory();
     factory.setScope(Scope.LOCAL);
     createRegion(this.regionName, this.rootRegionName, factory.create());
-    //    Wait.pause(1000);
+    Wait.pause(1000);
     try {
       startBridgeServer(0, false);
     } catch (Exception ex) {
@@ -2058,9 +2118,9 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
     for (int i = 0; i < queryString.length; i++) {
       try {
-        LogService.getLogger().info("### Executing Query :" + queryString[i]);
+        LogWriterUtils.getLogWriter().info("### Executing Query :" + queryString[i]);
         Query query = qService.newQuery(queryString[i]);
-        query.execute(params[i]);
+        SelectResults results = (SelectResults) query.execute(params[i]);
       } catch (Exception e) {
         Assert.fail("Failed executing " + queryString[i], e);
       }
@@ -2094,13 +2154,13 @@ public class QueryUsingPoolDUnitTest extends CacheTestCase {
 
   /* Close Client */
   public void closeClient() {
-    LogService.getLogger().info("### Close Client. ###");
+    LogWriterUtils.getLogWriter().info("### Close Client. ###");
     try {
       closeCache();
     } catch (Exception ex) {
-      LogService.getLogger().info("### Failed to get close client. ###");
+      LogWriterUtils.getLogWriter().info("### Failed to get close client. ###");
     }
-    //    Wait.pause(2 * 1000);
+    Wait.pause(2 * 1000);
   }
 
   private static int getCacheServerPort() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7051c7ad/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
index fe63813..6a719ab 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/cache/internal/JUnit4CacheTestCase.java
@@ -23,9 +23,7 @@ import java.io.PrintWriter;
 import java.util.Arrays;
 import java.util.Map;
 import java.util.Properties;
-import java.util.concurrent.TimeUnit;
 
-import com.jayway.awaitility.Awaitility;
 import org.apache.logging.log4j.Logger;
 
 import com.gemstone.gemfire.cache.AttributesFactory;
@@ -111,8 +109,6 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements
Ca
         System.setProperty("gemfire.DISABLE_DISCONNECT_DS_ON_CACHE_CLOSE", "true");
         Cache newCache;
         if (client) {
-          System.setProperty("gemfire.locators", "");
-          System.setProperty("gemfire.mcast-port", "0");
           newCache = (Cache)new ClientCacheFactory(getSystem().getProperties()).create();
         } else {
           if(factory == null) {
@@ -244,9 +240,16 @@ public class JUnit4CacheTestCase extends JUnit4DistributedTestCase implements
Ca
       final GemFireCacheImpl gemFireCache = GemFireCacheImpl.getInstance();
       if (gemFireCache != null && !gemFireCache.isClosed()
               && gemFireCache.getCancelCriterion().cancelInProgress() != null) {
-        Awaitility.await().pollDelay(100, TimeUnit.MILLISECONDS)
-            .pollInterval(100,TimeUnit.MILLISECONDS).timeout(60,TimeUnit.SECONDS)
-            .until(() -> gemFireCache.isClosed());
+        Wait.waitForCriterion(new WaitCriterion() { // TODO: replace with Awaitility
+          @Override
+          public boolean done() {
+            return gemFireCache.isClosed();
+          }
+          @Override
+          public String description() {
+            return "waiting for cache to close";
+          }
+        }, 30 * 1000, 300, true);
       }
       if (cache == null || cache.isClosed()) {
         cache = null;


Mime
View raw message