geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject [geode] branch develop updated: GEODE-4473: Removed GemFireCacheImpl.getInstance() calls
Date Fri, 16 Feb 2018 00:45:25 GMT
This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4595d69  GEODE-4473: Removed GemFireCacheImpl.getInstance() calls
4595d69 is described below

commit 4595d6987a9d7ca9961c05694f6244bdaf315474
Author: nabarun <nnag@pivotal.io>
AuthorDate: Mon Feb 12 17:41:18 2018 -0800

    GEODE-4473: Removed GemFireCacheImpl.getInstance() calls
    
    	* Removed from CqDataUsingPoolDUnitTest
    	* Removed from CqStatsDUnitTest
    	* Removed from CqStatsUsingPoolDUnitTest
---
 .../query/cq/dunit/CqDataUsingPoolDUnitTest.java   | 25 ++++++++++++++--------
 .../cache/query/cq/dunit/CqStatsDUnitTest.java     |  8 +++----
 .../query/cq/dunit/CqStatsUsingPoolDUnitTest.java  |  8 +++----
 3 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
index 5d3ce14..2755934 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java
@@ -14,8 +14,16 @@
  */
 package org.apache.geode.cache.query.cq.dunit;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.apache.geode.test.dunit.Assert.*;
+import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_TIMEOUT;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.apache.geode.test.dunit.Assert.assertEquals;
+import static org.apache.geode.test.dunit.Assert.assertFalse;
+import static org.apache.geode.test.dunit.Assert.assertNotNull;
+import static org.apache.geode.test.dunit.Assert.assertNull;
+import static org.apache.geode.test.dunit.Assert.assertTrue;
+import static org.apache.geode.test.dunit.Assert.fail;
 
 import java.util.HashSet;
 import java.util.List;
@@ -24,11 +32,11 @@ import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.logging.log4j.Logger;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.EvictionAttributes;
 import org.apache.geode.cache.MirrorType;
@@ -54,9 +62,9 @@ import org.apache.geode.cache.query.internal.cq.CqQueryImpl.TestHook;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.cache30.CertifiableTestCacheListener;
 import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.PoolFactoryImpl;
 import org.apache.geode.internal.cache.tier.sockets.CacheServerTestUtil;
+import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.test.dunit.Assert;
 import org.apache.geode.test.dunit.AsyncInvocation;
 import org.apache.geode.test.dunit.Host;
@@ -80,6 +88,7 @@ public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
   protected CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest(); // TODO:
don't
                                                                                      // do
this!
+  private static final Logger logger = LogService.getLogger();
 
   @Override
   public final void postSetUp() throws Exception {
@@ -1487,13 +1496,11 @@ public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase
{
 
           CountDownLatch latch = new CountDownLatch(1);
           private int numEvents = 0;
-          Cache cache = GemFireCacheImpl.getInstance();
 
           @Override
           public void pauseUntilReady() {
             try {
-              cache.getLogger()
-                  .fine("CqQueryTestHook: Going to wait on latch until ready is called.");
+              logger.debug("CqQueryTestHook: Going to wait on latch until ready is called.");
               if (!latch.await(10, TimeUnit.SECONDS)) {
                 fail("query was never unlatched");
               }
@@ -1505,7 +1512,7 @@ public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase {
           @Override
           public void ready() {
             latch.countDown();
-            cache.getLogger().fine("CqQueryTestHook: The latch has been released.");
+            logger.debug("CqQueryTestHook: The latch has been released.");
           }
 
           @Override
@@ -1515,7 +1522,7 @@ public class CqDataUsingPoolDUnitTest extends JUnit4CacheTestCase {
 
           @Override
           public void setEventCount(int count) {
-            cache.getLogger().fine("CqQueryTestHook: Setting numEVents to: " + count);
+            logger.debug("CqQueryTestHook: Setting numEVents to: " + count);
             numEvents = count;
           }
         };
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsDUnitTest.java
index 07dd192..138fafc 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsDUnitTest.java
@@ -14,7 +14,8 @@
  */
 package org.apache.geode.cache.query.cq.dunit;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.Collection;
 
@@ -35,7 +36,6 @@ import org.apache.geode.cache.query.internal.cq.CqServiceImpl;
 import org.apache.geode.cache.query.internal.cq.CqServiceVsdStats;
 import org.apache.geode.cache.query.internal.cq.InternalCqQuery;
 import org.apache.geode.cache30.CacheSerializableRunnable;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.LogWriterUtils;
@@ -187,7 +187,7 @@ public class CqStatsDUnitTest extends JUnit4CacheTestCase {
                 + cqServiceStats.numCqsStopped() + " CQs closed: " + cqServiceStats.numCqsClosed()
                 + " CQs on Client: " + cqServiceStats.numCqsOnClient()
                 + " CQs on region /root/regionA : "
-                + cqServiceVsdStats.numCqsOnRegion(GemFireCacheImpl.getInstance(), "/root/regionA")
+                + cqServiceVsdStats.numCqsOnRegion(getCache(), "/root/regionA")
                 + " Clients with CQs: " + cqServiceVsdStats.getNumClientsWithCqs());
 
 
@@ -221,7 +221,7 @@ public class CqStatsDUnitTest extends JUnit4CacheTestCase {
         // Check for CQs on region.
         if (cqsOnRegion != CqQueryDUnitTest.noTest) {
           assertEquals("Number of CQs on region /root/regionA mismatch", cqsOnRegion,
-              cqServiceVsdStats.numCqsOnRegion(GemFireCacheImpl.getInstance(), "/root/regionA"));
+              cqServiceVsdStats.numCqsOnRegion(getCache(), "/root/regionA"));
         }
 
         // Check for clients with CQs count.
diff --git a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
index 68bfe65..aec1258 100644
--- a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
+++ b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqStatsUsingPoolDUnitTest.java
@@ -14,7 +14,8 @@
  */
 package org.apache.geode.cache.query.cq.dunit;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.Collection;
 import java.util.Properties;
@@ -37,7 +38,6 @@ import org.apache.geode.cache.query.internal.cq.CqServiceVsdStats;
 import org.apache.geode.cache.query.internal.cq.InternalCqQuery;
 import org.apache.geode.cache30.CacheSerializableRunnable;
 import org.apache.geode.distributed.ConfigurationProperties;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.Invoke;
 import org.apache.geode.test.dunit.LogWriterUtils;
@@ -196,7 +196,7 @@ public class CqStatsUsingPoolDUnitTest extends JUnit4CacheTestCase {
                 + cqServiceStats.numCqsStopped() + " CQs closed: " + cqServiceStats.numCqsClosed()
                 + " CQs on Client: " + cqServiceStats.numCqsOnClient()
                 + " CQs on region /root/regionA : "
-                + cqServiceVsdStats.numCqsOnRegion(GemFireCacheImpl.getInstance(), "/root/regionA")
+                + cqServiceVsdStats.numCqsOnRegion(getCache(), "/root/regionA")
                 + " Clients with CQs: " + cqServiceVsdStats.getNumClientsWithCqs());
 
 
@@ -230,7 +230,7 @@ public class CqStatsUsingPoolDUnitTest extends JUnit4CacheTestCase {
         // Check for CQs on region.
         if (cqsOnRegion != CqQueryUsingPoolDUnitTest.noTest) {
           assertEquals("Number of CQs on region /root/regionA mismatch", cqsOnRegion,
-              cqServiceVsdStats.numCqsOnRegion(GemFireCacheImpl.getInstance(), "/root/regionA"));
+              cqServiceVsdStats.numCqsOnRegion(getCache(), "/root/regionA"));
         }
 
         // Check for clients with CQs count.

-- 
To stop receiving notification emails like this one, please contact
nnag@apache.org.

Mime
View raw message