You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2016/02/19 02:05:51 UTC
[08/16] incubator-geode git commit: more cleanup of FragmentJUnitTest
more cleanup of FragmentJUnitTest
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a1a7027e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a1a7027e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a1a7027e
Branch: refs/heads/feature/GEODE-831
Commit: a1a7027efb93fa35a1b50ba88986b47661e84d7b
Parents: 58c8fc8
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Feb 17 17:07:02 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Feb 17 17:07:02 2016 -0800
----------------------------------------------------------------------
.../gemfire/internal/offheap/FragmentJUnitTest.java | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a1a7027e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/FragmentJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/FragmentJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/FragmentJUnitTest.java
index a10564f..acecf97 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/FragmentJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/FragmentJUnitTest.java
@@ -18,7 +18,6 @@
package com.gemstone.gemfire.internal.offheap;
import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
import static org.hamcrest.CoreMatchers.*;
import java.util.Arrays;
@@ -38,8 +37,6 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
@Category(UnitTest.class)
public class FragmentJUnitTest {
- private OutOfOffHeapMemoryListener ooohml;
- private OffHeapMemoryStats stats;
private UnsafeMemoryChunk[] slabs;
static {
@@ -63,18 +60,16 @@ public class FragmentJUnitTest {
@Before
public void setUp() throws Exception {
- ooohml = mock(OutOfOffHeapMemoryListener.class);
- stats = mock(OffHeapMemoryStats.class);
-
UnsafeMemoryChunk slab1 = new UnsafeMemoryChunk((int)OffHeapStorage.MIN_SLAB_SIZE);
UnsafeMemoryChunk slab2 = new UnsafeMemoryChunk((int)OffHeapStorage.MIN_SLAB_SIZE);
slabs = new UnsafeMemoryChunk[]{slab1, slab2};
- SimpleMemoryAllocatorImpl.createForUnitTest(ooohml, stats, slabs);
}
@After
public void tearDown() throws Exception {
- SimpleMemoryAllocatorImpl.freeOffHeapMemory();
+ for (int i=0; i < slabs.length; i++) {
+ slabs[i].release();
+ }
}