usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [32/50] [abbrv] incubator-usergrid git commit: Added fix to OrderByTest
Date Mon, 01 Jun 2015 21:48:41 GMT
Added fix to OrderByTest


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

Branch: refs/heads/USERGRID-628
Commit: 45b4feb1cee3daf82dea307b27c88ffa0ab1d9a5
Parents: b8f93bb
Author: GERey <greyes@apigee.com>
Authored: Fri May 29 13:23:25 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Fri May 29 13:23:25 2015 -0700

----------------------------------------------------------------------
 .../usergrid/rest/applications/queries/OrderByTest.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/45b4feb1/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 16dd7f8..24d264d 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
@@ -340,7 +340,7 @@ public class OrderByTest extends QueryTestBase {
         long lastCreated = Long.parseLong(activities[0].get("created").toString());
         //2. Query for the entities in descending order
         String errorQuery = String.format("select * where created <= %d order by created
desc", lastCreated);
-        int index = size - 1;
+        int index = 0;
 
         QueryParameters params = new QueryParameters().setQuery(errorQuery);
         Collection activitiesResponse = this.app().collection("activities").get(params);
@@ -348,9 +348,9 @@ public class OrderByTest extends QueryTestBase {
         do {
             int returnSize = activitiesResponse.getResponse().getEntityCount();
             //loop through the current page of results
-            for (int i = 0; i < returnSize; i++, index--) {
-                assertEquals(activitiesResponse.getResponse().getEntities().get(i).get("uuid").toString(),
-                    (activities[i]).get("uuid").toString());
+            for (int i = 0; i < returnSize; i++, index++) {
+                assertEquals( ( activities[index] ).get( "uuid" ).toString(),
+                    activitiesResponse.getResponse().getEntities().get(i).get("uuid").toString());
             }
             //grab the next page of results
             activitiesResponse = this.app().collection("activities").getNextPage(activitiesResponse,
params, true);


Mime
View raw message