You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/07/26 21:17:08 UTC
[06/11] usergrid git commit: Add three additional query tests to
EntityIndexTest and add references to USERGRID-1314 where appropriate.
Add three additional query tests to EntityIndexTest and add references to USERGRID-1314 where appropriate.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/7c8ba0d2
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/7c8ba0d2
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/7c8ba0d2
Branch: refs/heads/master
Commit: 7c8ba0d2d8847fd44cf8612c8ac583d858aa6726
Parents: d7bb25a
Author: Dave Johnson <sn...@apache.org>
Authored: Wed Jul 20 13:59:51 2016 -0400
Committer: Dave Johnson <sn...@apache.org>
Committed: Wed Jul 20 13:59:51 2016 -0400
----------------------------------------------------------------------
.../persistence/index/impl/EntityIndexTest.java | 12 +++++++++++-
stack/query-validator/pom.xml | 14 --------------
.../usergrid/query/validator/users/UserQueryIT.java | 13 +++++--------
3 files changed, 16 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/7c8ba0d2/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 c84635d..3ee5f6f 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
@@ -390,7 +390,7 @@ public class EntityIndexTest extends BaseIT {
StopWatch timer = new StopWatch();
timer.start();
- CandidateResults candidateResults = entityIndex.search( scope, searchTypes, queryString, num == 0 ? 1 : num , 0 );
+ CandidateResults candidateResults = entityIndex.search( scope, searchTypes, queryString, 1000, 0 );
timer.stop();
@@ -402,6 +402,16 @@ public class EntityIndexTest extends BaseIT {
private void testQueries( final SearchEdge scope, SearchTypes searchTypes) {
+ testQuery( scope, searchTypes, "age > 35", 29 );
+
+ testQuery( scope, searchTypes, "age <= 35", 73 );
+
+ testQuery( scope, searchTypes, "age <= 35 or age > 35", 102 );
+
+ // TODO: uncomment this test when you are ready to fix USERGRID-1314
+ // (https://issues.apache.org/jira/browse/USERGRID-1314)
+ // testQuery( scope, searchTypes, "name = 'astro*' or age > 35", 29 );
+
testQuery( scope, searchTypes, "name = 'Morgan Pierce'", 1 );
testQuery( scope, searchTypes, "name = 'morgan pierce'", 1 );
http://git-wip-us.apache.org/repos/asf/usergrid/blob/7c8ba0d2/stack/query-validator/pom.xml
----------------------------------------------------------------------
diff --git a/stack/query-validator/pom.xml b/stack/query-validator/pom.xml
index 326abd3..e268656 100644
--- a/stack/query-validator/pom.xml
+++ b/stack/query-validator/pom.xml
@@ -250,20 +250,6 @@
<scope>test</scope>
</dependency>
- <!-- use the external test client. Just depend on the maven jetty plugin to launch jetty
- <dependency>
- <groupId>com.sun.jersey.jersey-test-framework</groupId>
- <artifactId>jersey-test-framework-external</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey.jersey-test-framework</groupId>
- <artifactId>jersey-test-framework-core</artifactId>
- <scope>test</scope>
- </dependency>
- -->
-
<dependency>
<groupId>org.apache.usergrid</groupId>
<artifactId>usergrid-java-client</artifactId>
http://git-wip-us.apache.org/repos/asf/usergrid/blob/7c8ba0d2/stack/query-validator/src/test/java/org/apache/usergrid/query/validator/users/UserQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/query-validator/src/test/java/org/apache/usergrid/query/validator/users/UserQueryIT.java b/stack/query-validator/src/test/java/org/apache/usergrid/query/validator/users/UserQueryIT.java
index 0c117ca..915b353 100644
--- a/stack/query-validator/src/test/java/org/apache/usergrid/query/validator/users/UserQueryIT.java
+++ b/stack/query-validator/src/test/java/org/apache/usergrid/query/validator/users/UserQueryIT.java
@@ -105,7 +105,7 @@ public class UserQueryIT extends AbstractQueryIT {
}
@Test
- @Ignore("TODO: why does this fail?")
+ @Ignore("TODO: uncomment this test when you are ready to fix USERGRID-1314")
public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortNameDesc() {
String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' " +
"ORDER BY name desc LIMIT 10";
@@ -120,7 +120,7 @@ public class UserQueryIT extends AbstractQueryIT {
}
@Test
- @Ignore("TODO: why does this fail?")
+ @Ignore("TODO: uncomment this test when you are ready to fix USERGRID-1314")
public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc() {
String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' " +
"ORDER BY address asc, name desc LIMIT 4";
@@ -136,7 +136,7 @@ public class UserQueryIT extends AbstractQueryIT {
}
@Test
- @Ignore("TODO: why does this fail?")
+ @Ignore("TODO: uncomment this test when you are ready to fix USERGRID-1314")
public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_sortAddressAscNameDesc_limitL4() {
String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 35 or sex = 'female' " +
"ORDER BY address asc, name desc LIMIT 4";
@@ -193,7 +193,6 @@ public class UserQueryIT extends AbstractQueryIT {
@Test
public void sexEqualAndAgeGreaterthanequal() {
- // TODO: why do we need order by here? It was not needed in 1.0
String sqlite = " SELECT * FROM users WHERE sex = 'male' and age >= 35 ORDER BY created DESC LIMIT 10";
String api = "select * where sex = 'male' and age >= 35 order by created desc";
@@ -300,7 +299,6 @@ public class UserQueryIT extends AbstractQueryIT {
@Test
public void limitL12() {
- // TODO: why do we need order by here? It was not needed in 1.0
String sqlite = "SELECT * FROM users order by created desc LIMIT 12";
String api = null;
int limit = 12;
@@ -343,7 +341,6 @@ public class UserQueryIT extends AbstractQueryIT {
@Test
public void limitL11() {
- // TODO: why do we need order by here? It was not needed in 1.0
String sqlite = "SELECT * FROM users order by created desc LIMIT 11";
String api = null;
int limit = 11;
@@ -357,7 +354,7 @@ public class UserQueryIT extends AbstractQueryIT {
}
@Test
- @Ignore("TODO: why does this fail?")
+ @Ignore("TODO: uncomment this test when you are ready to fix USERGRID-1314")
public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual() {
String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 " +
"or sex = 'female' LIMIT 10";
@@ -371,7 +368,7 @@ public class UserQueryIT extends AbstractQueryIT {
}
@Test
- @Ignore("TODO: why does this fail?")
+ @Ignore("TODO: uncomment this test when you are ready to fix USERGRID-1314")
public void nameBeginswithAndSexEqualAndAgeGreaterthanequalOrSexEqual_limitL20() {
String sqlite = "SELECT * FROM users WHERE name LIKE 'a%' and sex = 'male' and age >= 20 " +
"or sex = 'female' LIMIT 20";