ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shro...@apache.org
Subject [08/50] [abbrv] ignite git commit: IGNITE-3633 - Enforce key validation for tests.
Date Mon, 07 Nov 2016 04:29:55 GMT
IGNITE-3633 - Enforce key validation for tests.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/062b9b69
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/062b9b69
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/062b9b69

Branch: refs/heads/ignite-2788
Commit: 062b9b69aa851d5253dfb7f44066b7d749f1ca12
Parents: 3e8a1c6
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Sep 29 11:26:50 2016 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Sep 29 11:27:43 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java    | 7 +++++++
 .../cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java  | 6 ++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/062b9b69/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index fe6bb1b..55400ab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -4891,6 +4891,13 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
     }
 
     /**
+     * For tests only.
+     */
+    public void forceKeyCheck() {
+        keyCheck = true;
+    }
+
+    /**
      * Validates that given cache key has overridden equals and hashCode methods and
      * implements {@link Externalizable}.
      *

http://git-wip-us.apache.org/repos/asf/ignite/blob/062b9b69/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
index 7936ea4..150c245 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
@@ -894,6 +894,10 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends
GridCommonA
     public void testPutWithoutHashCode() throws Exception {
         final IgniteCache c = jcache(0);
 
+        GridCacheAdapter<Object, Object> cache0 = grid(0).context().cache().internalCache(null);
+
+        cache0.forceKeyCheck();
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             /** {@inheritDoc} */
             @Override public Object call() throws Exception {
@@ -907,6 +911,8 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
 
         final BinaryObject binKey = bldr.build();
 
+        cache0.forceKeyCheck();
+
         GridTestUtils.assertThrows(log, new Callable<Object>() {
             /** {@inheritDoc} */
             @Override public Object call() throws Exception {


Mime
View raw message