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 5f08a9e  GEODE-3935: Closing down the cache after each test.
5f08a9e is described below

commit 5f08a9ee40116b9ef926410862f5daa749ddfb24
Author: nabarun <n...@pivotal.io>
AuthorDate: Tue Oct 31 13:57:52 2017 -0700

    GEODE-3935: Closing down the cache after each test.
    
        * Test failure was attributed to an incompatible cache present in the 
system.
        * The @Before method will close the existing cache before each test.
---
 .../java/org/apache/geode/security/query/QuerySecurityBase.java  | 9 ++++++++-
 .../cache/query/cq/dunit/CqSecurityAuthorizedUserDUnitTest.java  | 3 ---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/geode-core/src/test/java/org/apache/geode/security/query/QuerySecurityBase.java
 
b/geode-core/src/test/java/org/apache/geode/security/query/QuerySecurityBase.java
index 3e71817..3cbbb1e 100644
--- 
a/geode-core/src/test/java/org/apache/geode/security/query/QuerySecurityBase.java
+++ 
b/geode-core/src/test/java/org/apache/geode/security/query/QuerySecurityBase.java
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
@@ -39,6 +38,7 @@ import org.apache.geode.cache.query.Query;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.TypeMismatchException;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.security.SecurityTestUtil;
 import org.apache.geode.security.TestSecurityManager;
 import org.apache.geode.test.dunit.Host;
@@ -81,6 +81,12 @@ public class QuerySecurityBase extends 
JUnit4DistributedTestCase {
     createProxyRegion(superUserClient, regionName);
   }
 
+  public void closeAnyPollutedCache() {
+    if (GemFireCacheImpl.getInstance() != null) {
+      GemFireCacheImpl.getInstance().close();
+    }
+  }
+
   public void setClientCache(ClientCache cache) {
     clientCache = cache;
   }
@@ -91,6 +97,7 @@ public class QuerySecurityBase extends 
JUnit4DistributedTestCase {
 
   public void createClientCache(VM vm, String userName, String password) {
     vm.invoke(() -> {
+      closeAnyPollutedCache();
       ClientCache cache = SecurityTestUtil.createClientCache(userName, 
password, server.getPort());
       setClientCache(cache);
     });
diff --git 
a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqSecurityAuthorizedUserDUnitTest.java
 
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqSecurityAuthorizedUserDUnitTest.java
index 298a273..d71bb1e 100644
--- 
a/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqSecurityAuthorizedUserDUnitTest.java
+++ 
b/geode-cq/src/test/java/org/apache/geode/cache/query/cq/dunit/CqSecurityAuthorizedUserDUnitTest.java
@@ -17,12 +17,9 @@ package org.apache.geode.cache.query.cq.dunit;
 import static org.apache.geode.internal.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
 
-import java.util.List;
 import java.util.concurrent.TimeUnit;
 
-import junitparams.Parameters;
 import org.awaitility.Awaitility;
 import org.junit.Before;
 import org.junit.Test;

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Reply via email to