geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [19/22] geode git commit: GEODE-2773: Fix assertion error in the test.
Date Thu, 13 Apr 2017 17:18:40 GMT
GEODE-2773: Fix assertion error in the test.


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

Branch: refs/heads/feature/GEODE-2632
Commit: 796c15ec5894c64a713633f5912078b827859691
Parents: c9b036b
Author: eshu <eshu@pivotal.io>
Authored: Thu Apr 13 09:21:10 2017 -0700
Committer: eshu <eshu@pivotal.io>
Committed: Thu Apr 13 09:21:10 2017 -0700

----------------------------------------------------------------------
 .../geode/internal/cache/GIIDeltaDUnitTest.java | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/796c15ec/geode-core/src/test/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java
index d07227b..bfa30c3 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/GIIDeltaDUnitTest.java
@@ -2543,13 +2543,15 @@ public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
   }
 
   private SerializableRunnable onePutOp(final String key, final String value,
-      final long regionVersionForThisOp, final DiskStoreID memberID) {
+      final long regionVersionForThisOp, final DiskStoreID memberID, final boolean syncInvocation)
{
     SerializableRunnable putOp = new SerializableRunnable("put " + key) {
       public void run() {
         LocalRegion lr = (LocalRegion) getCache().getRegion(REGION_NAME);
         lr.put(key, value);
         long region_version = getRegionVersionForMember(lr.getVersionVector(), memberID,
false);
-        assertEquals(regionVersionForThisOp, region_version);
+        if (syncInvocation) {
+          assertEquals(regionVersionForThisOp, region_version);
+        }
       }
     };
     return putOp;
@@ -2557,14 +2559,14 @@ public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
 
   private void doOnePut(final VM vm, final long regionVersionForThisOp, final String key)
{
     SerializableRunnable putOp =
-        onePutOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm));
+        onePutOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), true);
     vm.invoke(putOp);
   }
 
   private AsyncInvocation doOnePutAsync(final VM vm, final long regionVersionForThisOp,
       final String key) {
     SerializableRunnable putOp =
-        onePutOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm));
+        onePutOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), false);
     AsyncInvocation async = vm.invokeAsync(putOp);
     return async;
   }
@@ -2574,13 +2576,15 @@ public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
   }
 
   private SerializableRunnable oneDestroyOp(final String key, final String value,
-      final long regionVersionForThisOp, final DiskStoreID memberID) {
+      final long regionVersionForThisOp, final DiskStoreID memberID, final boolean syncInvocation)
{
     SerializableRunnable destroyOp = new SerializableRunnable("destroy " + key) {
       public void run() {
         LocalRegion lr = (LocalRegion) getCache().getRegion(REGION_NAME);
         lr.destroy(key);
         long region_version = getRegionVersionForMember(lr.getVersionVector(), memberID,
false);
-        assertEquals(regionVersionForThisOp, region_version);
+        if (syncInvocation) {
+          assertEquals(regionVersionForThisOp, region_version);
+        }
       }
     };
     return destroyOp;
@@ -2588,14 +2592,14 @@ public class GIIDeltaDUnitTest extends JUnit4CacheTestCase {
 
   private void doOneDestroy(final VM vm, final long regionVersionForThisOp, final String
key) {
     SerializableRunnable destroyOp =
-        oneDestroyOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm));
+        oneDestroyOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), true);
     vm.invoke(destroyOp);
   }
 
   private AsyncInvocation doOneDestroyAsync(final VM vm, final long regionVersionForThisOp,
       final String key) {
     SerializableRunnable destroyOp =
-        oneDestroyOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm));
+        oneDestroyOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), false);
     AsyncInvocation async = vm.invokeAsync(destroyOp);
     return async;
   }


Mime
View raw message