geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [5/7] incubator-geode git commit: GEODE-1816: Workaround to clear statics in CacheCreationJUnitTest
Date Thu, 25 Aug 2016 18:27:04 GMT
GEODE-1816: Workaround to clear statics in CacheCreationJUnitTest

Working around the fact that other tests are leaving static thread
locals set, causing this test to fail. The actual fix is to remove the
static thread locals from the product.


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

Branch: refs/heads/feature/GEODE-1817
Commit: 98531a16f8844a1028e2e6de293eb080d8ea7a1d
Parents: 8c85ef9
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Aug 24 16:57:10 2016 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Aug 24 16:57:10 2016 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/internal/cache/CacheServerLauncher.java  | 7 +++++++
 .../internal/cache/xmlcache/CacheCreationJUnitTest.java       | 2 ++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98531a16/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
index 17875bf..fcb0876 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
@@ -615,6 +615,13 @@ public class CacheServerLauncher  {
     return disableDefaultServer.get();
   }
 
+  public static void clearStatics() {
+    disableDefaultServer.set(null);
+    serverPort.set(null);
+    serverBindAddress.set(null);
+  }
+
+
   /**
    * The method that does the work of being a cache server.  It is
    * invoked in the VM spawned by the {@link #start} method.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98531a16/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
index e99a04b..d081e82 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
@@ -35,6 +35,7 @@ import org.mockito.MockitoAnnotations;
 
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.CacheServerLauncher;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
@@ -47,6 +48,7 @@ public class CacheCreationJUnitTest {
   @Before
   public void setUp() {
     MockitoAnnotations.initMocks(this);
+    CacheServerLauncher.clearStatics();
   }
 
   @Test


Mime
View raw message