geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [16/16] geode git commit: test now closes the cache it creates
Date Tue, 11 Apr 2017 17:52:48 GMT
test now closes the cache it creates


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

Branch: refs/heads/feature/GEODE-2485
Commit: 397b1b39797f88e71f0334ca14f39b4335d9a2a0
Parents: 0aebf39
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Tue Apr 11 10:42:55 2017 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Tue Apr 11 10:42:55 2017 -0700

----------------------------------------------------------------------
 .../internal/cache/GemFireCacheImplTest.java    | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/397b1b39/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
index 85bc6a9..6838e74 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
@@ -42,19 +42,23 @@ public class GemFireCacheImplTest {
     TypeRegistry typeRegistry = mock(TypeRegistry.class);
     SystemTimer ccpTimer = mock(SystemTimer.class);
     GemFireCacheImpl gfc = GemFireCacheImpl.createWithAsyncEventListeners(ds, cc, typeRegistry);
-    gfc.setCCPTimer(ccpTimer);
-    for (int i = 1; i < GemFireCacheImpl.PURGE_INTERVAL; i++) {
-      gfc.purgeCCPTimer();
-      verify(ccpTimer, times(0)).timerPurge();
-    }
-    gfc.purgeCCPTimer();
-    verify(ccpTimer, times(1)).timerPurge();
-    for (int i = 1; i < GemFireCacheImpl.PURGE_INTERVAL; i++) {
+    try {
+      gfc.setCCPTimer(ccpTimer);
+      for (int i = 1; i < GemFireCacheImpl.PURGE_INTERVAL; i++) {
+        gfc.purgeCCPTimer();
+        verify(ccpTimer, times(0)).timerPurge();
+      }
       gfc.purgeCCPTimer();
       verify(ccpTimer, times(1)).timerPurge();
+      for (int i = 1; i < GemFireCacheImpl.PURGE_INTERVAL; i++) {
+        gfc.purgeCCPTimer();
+        verify(ccpTimer, times(1)).timerPurge();
+      }
+      gfc.purgeCCPTimer();
+      verify(ccpTimer, times(2)).timerPurge();
+    } finally {
+      gfc.close();
     }
-    gfc.purgeCCPTimer();
-    verify(ccpTimer, times(2)).timerPurge();
   }
 
   @Test


Mime
View raw message