ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dma...@apache.org
Subject [16/17] ignite git commit: IGNITE-3188: Binary marshaller doesn't unmarshal a void type (added tests)
Date Fri, 27 May 2016 11:30:55 GMT
IGNITE-3188: Binary marshaller doesn't unmarshal a void type (added tests)


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

Branch: refs/heads/master
Commit: e274d44a37fd1269e7a3a5f0000e1ee6139fd0b0
Parents: 6fcc7a4
Author: Denis Magda <dmagda@gridgain.com>
Authored: Thu May 26 14:57:52 2016 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Thu May 26 14:57:52 2016 +0300

----------------------------------------------------------------------
 .../binary/BinaryMarshallerSelfTest.java        | 15 ++++++++
 .../CacheKeepBinaryWithInterceptorTest.java     | 36 ++++++++++----------
 2 files changed, 33 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e274d44a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 936b1e6..065081a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -833,6 +833,21 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testVoid() throws Exception {
+        Class clazz = Void.class;
+
+        assertEquals(clazz, marshalUnmarshal(clazz));
+
+        clazz = Void.TYPE;
+
+        assertEquals(clazz, marshalUnmarshal(clazz));
+    }
+
+
+
+    /**
      *
      */
     private static class EnclosingObj implements Serializable {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e274d44a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/CacheKeepBinaryWithInterceptorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/CacheKeepBinaryWithInterceptorTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/CacheKeepBinaryWithInterceptorTest.java
index 60b48a8..74b8659 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/CacheKeepBinaryWithInterceptorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/CacheKeepBinaryWithInterceptorTest.java
@@ -110,23 +110,23 @@ public class CacheKeepBinaryWithInterceptorTest extends GridCommonAbstractTest
{
             cache.put(new TestKey(1), new TestValue(10));
 
             BinaryObject obj = (BinaryObject)cache.get(new TestKey(1));
-            assertEquals(10, obj.field("val"));
+            assertEquals(10, (int)obj.field("val"));
 
             asyncCache.get(new TestKey(1));
             obj = (BinaryObject)asyncCache.future().get();
-            assertEquals(10, obj.field("val"));
+            assertEquals(10, (int)obj.field("val"));
 
             Cache.Entry<BinaryObject, BinaryObject> e = (Cache.Entry)cache.getEntry(new
TestKey(1));
-            assertEquals(1, e.getKey().field("key"));
-            assertEquals(10, e.getValue().field("val"));
+            assertEquals(1, (int)e.getKey().field("key"));
+            assertEquals(10, (int)e.getValue().field("val"));
 
             asyncCache.getEntry(new TestKey(1));
             e = (Cache.Entry)asyncCache.future().get();
-            assertEquals(1, e.getKey().field("key"));
-            assertEquals(10, e.getValue().field("val"));
+            assertEquals(1, (int)e.getKey().field("key"));
+            assertEquals(10, (int)e.getValue().field("val"));
 
             obj = (BinaryObject)cache.getAndRemove(new TestKey(1));
-            assertEquals(10, obj.field("val"));
+            assertEquals(10, (int)obj.field("val"));
 
             cache.put(new TestKey(1), new TestValue(10));
 
@@ -239,8 +239,8 @@ public class CacheKeepBinaryWithInterceptorTest extends GridCommonAbstractTest
{
 
             onGet++;
 
-            assertEquals(1, key.field("key"));
-            assertEquals(10, val.field("val"));
+            assertEquals(1, (int)key.field("key"));
+            assertEquals(10, (int)val.field("val"));
 
             return val;
         }
@@ -252,10 +252,10 @@ public class CacheKeepBinaryWithInterceptorTest extends GridCommonAbstractTest
{
             onBeforePut++;
 
             if (entry.getValue() != null)
-                assertEquals(10, entry.getValue().field("val"));
+                assertEquals(10, (int)entry.getValue().field("val"));
 
-            assertEquals(1, entry.getKey().field("key"));
-            assertEquals(10, newVal.field("val"));
+            assertEquals(1, (int)entry.getKey().field("key"));
+            assertEquals(10, (int)newVal.field("val"));
 
             return newVal;
         }
@@ -266,14 +266,14 @@ public class CacheKeepBinaryWithInterceptorTest extends GridCommonAbstractTest
{
 
             onAfterPut++;
 
-            assertEquals(1, entry.getKey().field("key"));
-            assertEquals(10, entry.getValue().field("val"));
+            assertEquals(1, (int)entry.getKey().field("key"));
+            assertEquals(10, (int)entry.getValue().field("val"));
         }
 
         /** {@inheritDoc} */
         @Nullable @Override public IgniteBiTuple<Boolean, BinaryObject> onBeforeRemove(Cache.Entry<BinaryObject,
BinaryObject> entry) {
-            assertEquals(1, entry.getKey().field("key"));
-            assertEquals(10, entry.getValue().field("val"));
+            assertEquals(1, (int)entry.getKey().field("key"));
+            assertEquals(10, (int)entry.getValue().field("val"));
 
             onBeforeRmv++;
 
@@ -286,8 +286,8 @@ public class CacheKeepBinaryWithInterceptorTest extends GridCommonAbstractTest
{
 
             onAfterRmv++;
 
-            assertEquals(1, entry.getKey().field("key"));
-            assertEquals(10, entry.getValue().field("val"));
+            assertEquals(1, (int)entry.getKey().field("key"));
+            assertEquals(10, (int)entry.getValue().field("val"));
         }
     }
 


Mime
View raw message