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/10 19:29:00 UTC

[2/2] incubator-usergrid git commit: Added a test that highlights USERGRID-904

Added a test that highlights USERGRID-904


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

Branch: refs/heads/UESRGRID-904
Commit: 4a6c544a66551fb0b7a6922fc92394e7761465c0
Parents: 4d75b6b
Author: GERey <gr...@apigee.com>
Authored: Mon Aug 10 10:28:57 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Aug 10 10:28:57 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a6c544a/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 869d5b1..50d98a0 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
@@ -82,6 +82,29 @@ public class OrderByTest extends QueryTestBase {
         assertEquals( "fury ",activities.getResponse().getEntities().get( 0 ).get( "random" ) );
     }
 
+    @Test
+    public void testValueWithStrangeEncodingsStillReturn() throws IOException {
+        String encodingTestString = "%7Bfury%7D";
+        String collectionName = "stuff";
+        Entity spaceAtTheEndOfString = new Entity();
+        spaceAtTheEndOfString.put( "name","thing1" );
+        spaceAtTheEndOfString.put( "random", encodingTestString );
+        this.app().collection( collectionName ).post( spaceAtTheEndOfString );
+
+//        //Add an extra entity to make sure this won't be returned in the below query.
+//        Entity noSpaceButSimilarString = new Entity();
+//        noSpaceButSimilarString.put( "name","thing2" );
+//        noSpaceButSimilarString.put( "random", "fury" );
+//        this.app().collection( collectionName ).post( noSpaceButSimilarString );
+//        refreshIndex();
+
+        QueryParameters params = new QueryParameters()
+            .setQuery("select * where random = \"%7Bfury%7D\"");
+        Collection activities = this.app().collection(collectionName ).get(params);
+        assertEquals(1, activities.getResponse().getEntityCount());
+        assertEquals( encodingTestString,activities.getResponse().getEntities().get( 0 ).get( "random" ) );
+    }
+
     /**
      * Test correct sort order for Long properties
      *