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 2015/09/29 23:35:20 UTC

[3/8] incubator-geode git commit: unit test coverage of null object

unit test coverage of null object


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

Branch: refs/heads/feature/GEODE-324
Commit: bb2cdb00b3882f4c12d43ae489155bb6d8a4b83b
Parents: 84fa440
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Tue Sep 29 10:58:40 2015 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Tue Sep 29 10:58:40 2015 -0700

----------------------------------------------------------------------
 .../internal/cache/PutReplyMessageJUnitTest.java        | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/bb2cdb00/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutReplyMessageJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutReplyMessageJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutReplyMessageJUnitTest.java
index 9f72627..75d90e1 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutReplyMessageJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/PutReplyMessageJUnitTest.java
@@ -40,9 +40,19 @@ public class PutReplyMessageJUnitTest {
     HeapDataOutputStream hdos = new HeapDataOutputStream(bytes);
     PutReplyMessage imsg = new PutReplyMessage();
 
-    // null value
+    // null byte array value
     {
       PutReplyMessage omsg = new PutReplyMessage(1, true, Operation.PUT_IF_ABSENT, null, null, null);
+      omsg.importOldBytes(null, false);
+      omsg.toData(hdos);
+      imsg.fromData(new DataInputStream(new ByteArrayInputStream(bytes)));
+      assertEquals(null, imsg.getOldValue());
+    }
+    
+    // null object value
+    {
+      PutReplyMessage omsg = new PutReplyMessage(1, true, Operation.PUT_IF_ABSENT, null, null, null);
+      omsg.importOldObject(null, true);
       omsg.toData(hdos);
       imsg.fromData(new DataInputStream(new ByteArrayInputStream(bytes)));
       assertEquals(null, imsg.getOldValue());