You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/08/04 21:18:40 UTC

incubator-usergrid git commit: Added test proving USERGRID-902

Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-902 [created] 3221906f4


Added test proving USERGRID-902


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

Branch: refs/heads/USERGRID-902
Commit: 3221906f437e65f7d3d334062e365c0d08dc2978
Parents: 6b90b66
Author: GERey <gr...@apigee.com>
Authored: Tue Aug 4 12:18:37 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Tue Aug 4 12:18:37 2015 -0700

----------------------------------------------------------------------
 .../rest/applications/queries/OrderByTest.java  | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3221906f/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 99a2a77..22d6c47 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
@@ -61,6 +61,30 @@ public class OrderByTest extends QueryTestBase {
     }
 
 
+    @Test
+    public void testQueryEqualityHonorsCaseSensitivity() throws IOException {
+        String collectionName = "stuff";
+        Entity lowerCaseEntity = new Entity();
+        lowerCaseEntity.put( "name","thing1" );
+        lowerCaseEntity.put( "random","fury" );
+
+        Entity mixedCaseEntity = new Entity();
+        mixedCaseEntity.put( "name","thing2" );
+        mixedCaseEntity.put( "random","Fury" );
+        //create our test entities
+        this.app().collection( collectionName ).post( lowerCaseEntity );
+        this.app().collection( collectionName ).post( mixedCaseEntity );
+
+        refreshIndex();
+
+        QueryParameters params = new QueryParameters()
+            .setQuery("select * where random = 'fury' ");
+        Collection activities = this.app().collection(collectionName).get(params);
+        assertEquals(1, activities.getResponse().getEntityCount());
+        assertEquals( "fury",activities.getResponse().getEntities().get( 0 ).get( "random" ) );
+    }
+
+
     /**
      * Test correct sort order for Long properties
      *