usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [1/7] incubator-usergrid git commit: [USERGRID-303]fixed tests after framework update
Date Wed, 07 Jan 2015 22:47:19 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-313 421a1d9d8 -> f789821a6


[USERGRID-303]fixed tests after framework update


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

Branch: refs/heads/USERGRID-313
Commit: 0141aad4dc3ddcb8ac1440ab06c9279e68704713
Parents: 7253390
Author: ryan bridges <rbridges@apigee.com>
Authored: Wed Jan 7 14:42:45 2015 -0500
Committer: ryan bridges <rbridges@apigee.com>
Committed: Wed Jan 7 14:44:29 2015 -0500

----------------------------------------------------------------------
 .../applications/queries/AndOrQueryTest.java    | 28 ++++++++++----------
 .../applications/queries/GeoPagingTest.java     | 18 ++++++-------
 .../applications/queries/MatrixQueryTests.java  |  6 ++---
 .../rest/applications/queries/OrderByTest.java  | 10 +++----
 4 files changed, 31 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0141aad4/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
index 5e619be..59329bc 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/AndOrQueryTest.java
@@ -85,7 +85,7 @@ public class AndOrQueryTest extends AbstractRestIT {
         .setLimit(numValuesTested / 2);//4. Limit the query to half of the number of entities
     Collection activities = this.app().collection("activities").get(params);
     //5. Ensure the correct entities are returned
-    assertEquals(numValuesTested / 2, activities.response.getEntityCount());
+    assertEquals(numValuesTested / 2, activities.getResponse().getEntityCount());
     while (activities.hasNext()) {
       assertTrue(Boolean.parseBoolean(activities.next().get("madeup").toString()));
     }
@@ -135,7 +135,7 @@ public class AndOrQueryTest extends AbstractRestIT {
     QueryParameters params = new QueryParameters().setQuery(query).setLimit(numValuesTested
/ 2);
     Collection activities = this.app().collection("activities").get(params);
     //5. Ensure the returned entities have "verb = 'stop'"
-    assertEquals(numValuesTested / 2, activities.response.getEntityCount());
+    assertEquals(numValuesTested / 2, activities.getResponse().getEntityCount());
     while (activities.hasNext()) {
       assertEquals("stop", activities.next().get("verb").toString());
     }
@@ -172,11 +172,11 @@ public class AndOrQueryTest extends AbstractRestIT {
     QueryParameters params = new QueryParameters().setQuery(inCorrectQuery).setLimit(numValuesTested
/ 2);
     Collection activities = this.app().collection("activities").get(params);
     //3. Validate that the correct entities are returned
-    assertEquals(numValuesTested / 2, activities.response.getEntityCount());
+    assertEquals(numValuesTested / 2, activities.getResponse().getEntityCount());
 
-    List entities = activities.response.getEntities();
+    List<Entity> entities = activities.getResponse().getEntities();
     for (int i = 0; i < numValuesTested / 2; i++) {
-      assertEquals(numValuesTested / 2 + i, Integer.parseInt(((LinkedHashMap<String, Object>)
entities.get(i)).get("ordinal").toString()));
+      assertEquals(numValuesTested / 2 + i, Integer.parseInt(entities.get(i).get("ordinal").toString()));
     }
 
   }
@@ -211,10 +211,10 @@ public class AndOrQueryTest extends AbstractRestIT {
     Collection activities = this.app().collection(collectionName).get(params);
 
     //3. Verify the order of results
-    assertEquals(numOfEntities / 2, activities.response.getEntityCount());
-    List entities = activities.response.getEntities();
+    assertEquals(numOfEntities / 2, activities.getResponse().getEntityCount());
+    List<Entity> entities = activities.getResponse().getEntities();
     for (int i = 0; i < numOfEntities / 2; i++) {
-      assertEquals(i, Integer.parseInt(((LinkedHashMap<String, Object>) entities.get(i)).get("ordinal").toString()));
+      assertEquals(i, Integer.parseInt(entities.get(i).get("ordinal").toString()));
     }
   }
 
@@ -248,10 +248,10 @@ public class AndOrQueryTest extends AbstractRestIT {
     Collection activities = this.app().collection(collectionName).get(params);
 
     //3. validate that a full page of (10) entities is returned
-    assertEquals(10, activities.response.getEntityCount());
-    List entities = activities.response.getEntities();
+    assertEquals(10, activities.getResponse().getEntityCount());
+    List<Entity> entities = activities.getResponse().getEntities();
     for (int i = 0; i < 10; i++) {
-      assertEquals(i, Integer.parseInt(((LinkedHashMap<String, Object>) entities.get(i)).get("ordinal").toString()));
+      assertEquals(i, Integer.parseInt(entities.get(i).get("ordinal").toString()));
     }
   }
 
@@ -284,10 +284,10 @@ public class AndOrQueryTest extends AbstractRestIT {
     Collection activities = this.app().collection(collectionName).get(params);
 
     //3. validate that a full page of (10) entities is returned
-    assertEquals(10, activities.response.getEntityCount());
-    List entities = activities.response.getEntities();
+    assertEquals(10, activities.getResponse().getEntityCount());
+    List<Entity> entities = activities.getResponse().getEntities();
     for (int i = 0; i < 10; i++) {
-      assertEquals(i, Integer.parseInt(((LinkedHashMap<String, Object>) entities.get(i)).get("ordinal").toString()));
+      assertEquals(i, Integer.parseInt(entities.get(i).get("ordinal").toString()));
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0141aad4/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
index 4a3ff80..044a249 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/GeoPagingTest.java
@@ -94,7 +94,7 @@ public class GeoPagingTest extends AbstractRestIT {
     QueryParameters params = new QueryParameters();
     params.setQuery(query);
     Collection collection = this.app().collection("groups").get(params);
-    assertEquals("Query should have returned 1 entity", 1, collection.response.getEntityCount());
+    assertEquals("Query should have returned 1 entity", 1, collection.getResponse().getEntityCount());
     Entity entity = collection.next();
     // 3. Verify that the desired entity i, and only the desired entity, is returned
     assertNotNull("Query should have returned 1 entity", entity);
@@ -142,13 +142,13 @@ public class GeoPagingTest extends AbstractRestIT {
     this.refreshIndex();
 
     Collection collection = this.app().collection(collectionType).get();
-    assertEquals("Should return both entities", 2, collection.response.getEntityCount());
+    assertEquals("Should return both entities", 2, collection.getResponse().getEntityCount());
     // 2. Query within a short distance of the center point to ensure that none are returned
     collection = this.app().collection(collectionType).get(queryClose);
-    assertEquals("Results from nearby, should return nothing", 0, collection.response.getEntityCount());
+    assertEquals("Results from nearby, should return nothing", 0, collection.getResponse().getEntityCount());
     // 3. Query within a huge distance of the center point to ensure that both are returned
     collection = this.app().collection(collectionType).get(queryFar);
-    assertEquals("Results from center point to ridiculously far", 2, collection.response.getEntityCount());
+    assertEquals("Results from center point to ridiculously far", 2, collection.getResponse().getEntityCount());
   }
 
   /**
@@ -193,8 +193,8 @@ public class GeoPagingTest extends AbstractRestIT {
       params.setQuery(query);
       Collection collection = this.app().collection("groups").get(params);
 
-      assertEquals(3, collection.response.getEntityCount());
-      List entities = collection.response.getEntities();
+      assertEquals(3, collection.getResponse().getEntityCount());
+      List entities = collection.getResponse().getEntities();
       // 3. Test that the entities were returned in the order expected
       for (int i = 0; i < 3; i++) {
         // shouldn't start at 10 since you're excluding it above in the query, it should
return 9,8,7
@@ -240,11 +240,11 @@ public class GeoPagingTest extends AbstractRestIT {
 
     // 2. Query from the center point to ensure that one is returned
     Collection collection = this.app().collection(collectionType).get(queryClose);
-    assertEquals("Results from nearby, should return 1 store", 1, collection.response.getEntityCount());
+    assertEquals("Results from nearby, should return 1 store", 1, collection.getResponse().getEntityCount());
 
     // 3. Query within a huge distance of the center point to ensure that both are returned
     collection = this.app().collection(collectionType).get(queryFar);
-    assertEquals("Results from center point to ridiculously far", 2, collection.response.getEntityCount());
+    assertEquals("Results from center point to ridiculously far", 2, collection.getResponse().getEntityCount());
   }
 
 
@@ -294,7 +294,7 @@ public class GeoPagingTest extends AbstractRestIT {
       QueryParameters params = new QueryParameters();
       params.setQuery(query);
       Collection collection = this.app().collection("users").get(params);
-      assertEquals("Expected 0 results", 0, collection.response.getEntityCount());
+      assertEquals("Expected 0 results", 0, collection.getResponse().getEntityCount());
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0141aad4/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/MatrixQueryTests.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/MatrixQueryTests.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/MatrixQueryTests.java
index 184e1c0..5b5b21b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/MatrixQueryTests.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/MatrixQueryTests.java
@@ -89,13 +89,13 @@ public class MatrixQueryTests extends AbstractRestIT {
 
     //4. Retrieve "likes" connections per user and ensure the correct restaurants are returned
     Collection user1likes = this.app().collection("users").entity(user1).connection("likes").get();
-    assertEquals(2, user1likes.response.getEntityCount());
+    assertEquals(2, user1likes.getResponse().getEntityCount());
 
     Collection user2likes = this.app().collection("users").entity(user2).connection("likes").get();
-    assertEquals(2, user2likes.response.getEntityCount());
+    assertEquals(2, user2likes.getResponse().getEntityCount());
 
     Collection user3likes = this.app().collection("users").entity(user3).connection("likes").get();
-    assertEquals(1, user3likes.response.getEntityCount());
+    assertEquals(1, user3likes.getResponse().getEntityCount());
   }
 
   //TODO implement matrix parameters and tests!!!

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0141aad4/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
index 5f78c5e..8edf698 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/queries/OrderByTest.java
@@ -77,12 +77,12 @@ public class OrderByTest extends AbstractRestIT {
     String query = "select * where created > " + created;
     QueryParameters params = new QueryParameters().setQuery(query);
     Collection activitiesWithoutOrderBy = this.app().collection("activities").get(params);
-    assertEquals(10, activitiesWithoutOrderBy.response.getEntityCount());
+    assertEquals(10, activitiesWithoutOrderBy.getResponse().getEntityCount());
     //3. Query with 'order by'
     query = query + " order by created desc";
     params.setQuery(query);
     Collection activitiesWithOrderBy = this.app().collection("activities").get(params);
-    assertEquals(10, activitiesWithOrderBy.response.getEntityCount());
+    assertEquals(10, activitiesWithOrderBy.getResponse().getEntityCount());
     //4. Ensure the same entities are returned
     while(activitiesWithoutOrderBy.hasNext() && activitiesWithOrderBy.hasNext())
{
       Entity activityWithoutOrderBy = activitiesWithoutOrderBy.next();
@@ -121,7 +121,7 @@ public class OrderByTest extends AbstractRestIT {
     QueryParameters params = new QueryParameters().setQuery(query).setLimit(5);
     Collection activities = this.app().collection("activities").get(params);
     //3. Ensure the correct number of results are returned
-    assertEquals(5, activities.response.getEntityCount());
+    assertEquals(5, activities.getResponse().getEntityCount());
 
   }
 
@@ -167,10 +167,10 @@ public class OrderByTest extends AbstractRestIT {
     Collection activitiesResponse = this.app().collection("activities").get(params);
     //3. Validate that the order is correct
     do {
-      int returnSize = activitiesResponse.response.getEntityCount();
+      int returnSize = activitiesResponse.getResponse().getEntityCount();
       //loop through the current page of results
       for (int i = 0; i < returnSize; i++, index--) {
-        assertEquals(((LinkedHashMap<String, Object>) activitiesResponse.response.getEntities().get(i)).get("uuid").toString(),
+        assertEquals(activitiesResponse.getResponse().getEntities().get(i).get("uuid").toString(),
             (activities[index]).get("uuid").toString());
       }
       //grab the next page of results


Mime
View raw message