usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [10/16] incubator-usergrid git commit: Added a helper method to collections. Changed the test to use this new helper method.
Date Wed, 07 Jan 2015 19:18:31 GMT
Added a helper method to collections.
Changed the test to use this new helper method.


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

Branch: refs/heads/USERGRID-313
Commit: 6c0158992ee28817f903a32f18c9af5745cadda8
Parents: 1e4d934
Author: grey <greyes@apigee.com>
Authored: Tue Jan 6 11:48:36 2015 -0800
Committer: grey <greyes@apigee.com>
Committed: Tue Jan 6 11:48:36 2015 -0800

----------------------------------------------------------------------
 .../rest/applications/collection/paging/PagingResourceIT.java    | 4 ++--
 .../usergrid/rest/test/resource2point0/model/Collection.java     | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c015899/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/paging/PagingResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/paging/PagingResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/paging/PagingResourceIT.java
index 2d3c609..b0c6efe 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/paging/PagingResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/paging/PagingResourceIT.java
@@ -117,7 +117,7 @@ public class PagingResourceIT extends AbstractRestIT {
         //verifies that we can't get anymore entities from the collection
         Collection getCollection = this.app().collection( collectionName ).get();
 
-        assertEquals( "All entities should have been removed", 0, getCollection.getResponse().getEntityCount()
);
+        assertFalse( "All entities should have been removed", getCollection.hasNext());
 
         //now do 1 more delete, we shouldn't get any results
         ApiResponse response = this.app().collection( collectionName ).delete( queryParameters
);
@@ -306,7 +306,7 @@ public class PagingResourceIT extends AbstractRestIT {
         Collection queryCollection = this.app().collection( collectionName ).get( queryParameters
);
         assertNotNull( queryCollection );
         assertNull( queryCollection.getCursor() );
-        assertEquals( numOfChangedEntities, queryCollection.getResponse().getEntities().size()
);
+        assertEquals( numOfChangedEntities, queryCollection.getNumOfEntities() );
 
         //Gets the supposed number of changed entities and checks they have the correct verb.
         for(int i = 0; i<numOfChangedEntities; i++){

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6c015899/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Collection.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Collection.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Collection.java
index 54d691d..2168e64 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Collection.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Collection.java
@@ -88,6 +88,9 @@ public class Collection implements Iterable<Entity>, Iterator<Entity>
{
         throw new UnsupportedOperationException( "Remove is unsupported" );
     }
 
+    public int getNumOfEntities(){
+        return response.getEntityCount();
+    }
 
     public ApiResponse getResponse(){return response;}
 


Mime
View raw message