You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/06/01 23:48:41 UTC

[32/50] [abbrv] incubator-usergrid git commit: Added fix to OrderByTest

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 <gr...@apigee.com>
Authored: Fri May 29 13:23:25 2015 -0700
Committer: GERey <gr...@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);