usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [15/50] usergrid git commit: remove entity size
Date Tue, 08 Sep 2015 21:06:18 GMT
remove entity size


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

Branch: refs/heads/usergrid-103-upgrade-jersey
Commit: f9bc01f5ef655d59de2c5a2044a7056b3dd189a4
Parents: af944cf
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Aug 31 14:24:38 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Aug 31 14:24:38 2015 -0600

----------------------------------------------------------------------
 .../src/main/java/org/apache/usergrid/persistence/Entity.java   | 1 +
 .../test/java/org/apache/usergrid/persistence/EntityTest.java   | 2 +-
 .../src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java | 2 +-
 .../usergrid/persistence/model/entity/MapToEntityConverter.java | 5 ++++-
 .../rest/applications/collection/users/UserResourceIT.java      | 2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f9bc01f5/stack/core/src/main/java/org/apache/usergrid/persistence/Entity.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/Entity.java b/stack/core/src/main/java/org/apache/usergrid/persistence/Entity.java
index b6176b8..5f353d9 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/Entity.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/Entity.java
@@ -103,6 +103,7 @@ public interface Entity extends EntityRef, Comparable<Entity> {
     @JsonAnyGetter
     public abstract Map<String, Object> getDynamicProperties();
 
+    @JsonIgnore
     long getSize();
     void setSize(long size);
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f9bc01f5/stack/core/src/test/java/org/apache/usergrid/persistence/EntityTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityTest.java b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityTest.java
index 0e29a71..e9e6163 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/EntityTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/EntityTest.java
@@ -81,7 +81,7 @@ public class EntityTest {
         User user = new User();
         // user.setId(UUIDUtils.newTimeUUID());
         user.setProperty( "foo", "bar" );
-        assertEquals( "{\"type\":\"user\",\"size\":0,\"foo\":\"bar\"}", JsonUtils.mapToJsonString(
user ) );
+        assertEquals( "{\"type\":\"user\",\"foo\":\"bar\"}", JsonUtils.mapToJsonString( user
) );
 
         String json = "{\"username\":\"edanuff\", \"bar\" : \"baz\" }";
         Map<String, Object> p = ( Map<String, Object> ) JsonUtils.parse( json
);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f9bc01f5/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
index a727e3f..c107f20 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/IndexUtilsTest.java
@@ -66,6 +66,6 @@ public class IndexUtilsTest {
             LOG.info( e.getKey() + " = " + e.getValue() );
         }
 
-        assertEquals( 8, l.size() );
+        assertEquals( 7, l.size() );
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f9bc01f5/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
index 441ddf1..09cf1f2 100644
--- a/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
+++ b/stack/corepersistence/model/src/main/java/org/apache/usergrid/persistence/model/entity/MapToEntityConverter.java
@@ -43,7 +43,9 @@ public class MapToEntityConverter{
     public Entity fromMap(final Entity entity,final  Map<String, Object> map,final
 SchemaManager schemaManager, final String entityType, boolean topLevel) {
 
         for ( String fieldName : map.keySet() ) {
-
+            if(fieldName.equals("size")){
+                continue;
+            }
             Object value = map.get( fieldName );
             boolean unique = schemaManager == null ? topLevel :  topLevel && schemaManager.isPropertyUnique(entityType,
fieldName);
 
@@ -63,6 +65,7 @@ public class MapToEntityConverter{
                 entity.setField( new FloatField( fieldName, (Float)value, unique ));
 
             } else if ( value instanceof Long ) {
+
                 entity.setField( new LongField( fieldName, (Long)value, unique ));
 
             } else if ( value instanceof List) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f9bc01f5/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
index b249fea..79b8c85 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
@@ -1070,7 +1070,7 @@ public class UserResourceIT extends AbstractRestIT {
 
             assertNotNull("List must exist", response.getResponse().getEntities());
             assertTrue("Must be some list items", response.getResponse().getEntities().size()
> 0);
-            assertTrue("Should have 4 items - [metadata, size, type, uuid]", response.getResponse().getEntities().get(0).keySet().size()
== 4);
+            assertTrue("Should have 4 items - [metadata, type, uuid]", response.getResponse().getEntities().get(0).keySet().size()
== 3);
 
         }
     }


Mime
View raw message