You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/08/10 23:45:00 UTC

[1/2] incubator-usergrid git commit: Fixed issue with having queries with spaces at the end being unqueryable.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 4887b0235 -> 566046bae


Fixed issue with having queries with spaces at the end being unqueryable.


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

Branch: refs/heads/two-dot-o
Commit: f65eac68c57489368ad20487210dd76ef18ac11d
Parents: 4887b02
Author: GERey <gr...@apigee.com>
Authored: Mon Aug 10 13:41:01 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Aug 10 13:41:01 2015 -0700

----------------------------------------------------------------------
 .../index/query/tree/StringLiteral.java         |  2 +-
 .../rest/applications/queries/OrderByTest.java  | 25 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f65eac68/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
index 92f9033..8b0bf52 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/query/tree/StringLiteral.java
@@ -53,7 +53,7 @@ public class StringLiteral extends Literal<String> {
     /** Parse the value and set the optional end value */
     private void parseValue( String value ) {
 
-        this.value = value.trim().toLowerCase();
+        this.value = value.toLowerCase();
 
         if ( "*".equals( value ) ) {
             this.value = null;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f65eac68/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 75f4a3f..1005412 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
@@ -124,6 +124,31 @@ public class OrderByTest extends QueryTestBase {
         }
     }
 
+
+    @Test
+    public void testValueWithSpaceAtEndStillQueryable() throws Exception {
+        String collectionName = "stuff";
+
+        Entity spaceAtTheEndOfString = new Entity();
+        spaceAtTheEndOfString.put( "name", "thing1" );
+        spaceAtTheEndOfString.put( "random", "fury " );
+        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();
+
+        Thread.sleep( 1000 );
+        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 Boolean properties
      *


[2/2] incubator-usergrid git commit: Fixed broken test in core due to changing space.

Posted by sf...@apache.org.
Fixed broken test in core due to changing space.


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

Branch: refs/heads/two-dot-o
Commit: 566046bae8c9d8dda1337e02851adf27685068cd
Parents: f65eac6
Author: GERey <gr...@apigee.com>
Authored: Mon Aug 10 14:30:51 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Aug 10 14:30:51 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/persistence/index/impl/EntityIndexTest.java    | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/566046ba/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index ca9bf79..e46fa89 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -393,8 +393,6 @@ public class EntityIndexTest extends BaseIT {
 
         testQuery(scope, searchTypes, entityIndex, "name = 'Minerva Harrell' and age <= 40", 1 );
 
-        testQuery(scope, searchTypes, entityIndex, "name = 'Morgan* '", 1 );
-
         testQuery(scope, searchTypes, entityIndex, "name = 'Morgan*'", 1 );