You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/10/02 23:12:54 UTC

[5/8] git commit: more tests

more tests


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

Branch: refs/heads/two-dot-o
Commit: 0152dcbd6bd6a64ca2e6566fc4e2440dedc6fd11
Parents: a784ebe
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Oct 2 14:43:03 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Oct 2 14:43:03 2014 -0600

----------------------------------------------------------------------
 .../persistence/map/impl/MapSerializationImpl.java   |  9 +++++++++
 .../usergrid/persistence/map/MapManagerTest.java     | 15 ++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0152dcbd/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
index 4e585fa..c6004f7 100644
--- a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
+++ b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java
@@ -99,6 +99,7 @@ public class MapSerializationImpl implements MapSerialization {
         Preconditions.checkNotNull(scope, "mapscope is required");
         Preconditions.checkNotNull( key, "key is required" );
         Preconditions.checkNotNull( value, "value is required" );
+
         final MutationBatch batch = keyspace.prepareMutationBatch();
 
         //add it to the entry
@@ -132,6 +133,10 @@ public class MapSerializationImpl implements MapSerialization {
     @Override
     public void putUuid( final MapScope scope, final String key, final UUID putUuid ) {
 
+        Preconditions.checkNotNull(scope, "mapscope is required");
+        Preconditions.checkNotNull( key, "key is required" );
+        Preconditions.checkNotNull( putUuid, "value is required" );
+
         final MutationBatch batch = keyspace.prepareMutationBatch();
 
         //add it to the entry
@@ -165,6 +170,10 @@ public class MapSerializationImpl implements MapSerialization {
     @Override
     public void putLong( final MapScope scope, final String key, final Long value ) {
 
+        Preconditions.checkNotNull(scope, "mapscope is required");
+        Preconditions.checkNotNull( key, "key is required" );
+        Preconditions.checkNotNull( value, "value is required" );
+
         final MutationBatch batch = keyspace.prepareMutationBatch();
 
         //add it to the entry

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0152dcbd/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
index 9702532..6977f35 100644
--- a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
+++ b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
@@ -167,9 +167,22 @@ public class MapManagerTest {
 
 
     @Test( expected = NullPointerException.class )
-    public void nullInput() {
+    public void nullInputString() {
         MapManager mm = mmf.getMapManager( this.scope );
 
         mm.putString( null, null );
     }
+
+    @Test( expected = NullPointerException.class )
+    public void nullInputLong() {
+        MapManager mm = mmf.getMapManager( this.scope );
+
+        mm.putLong( null, null );
+    }
+    @Test( expected = NullPointerException.class )
+     public void nullInputUUID() {
+        MapManager mm = mmf.getMapManager( this.scope );
+
+        mm.putUuid( null, null );
+    }
 }