usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [5/8] git commit: more tests
Date Thu, 02 Oct 2014 21:12:54 GMT
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 <sfeldman@apache.org>
Authored: Thu Oct 2 14:43:03 2014 -0600
Committer: Shawn Feldman <sfeldman@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 );
+    }
 }


Mime
View raw message