usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [20/50] [abbrv] usergrid git commit: Do not add "none" to list of required fields!
Date Mon, 02 May 2016 17:54:51 GMT
Do not add "none" to list of required fields!


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

Branch: refs/heads/USERGRID-1246-MASTER
Commit: 12f32eb3a12e5b37d8de342502bc62320e79c4e4
Parents: 6c00a1c
Author: Dave Johnson <snoopdave@apache.org>
Authored: Mon Apr 18 08:26:37 2016 -0400
Committer: George Reyes <grey@apache.org>
Committed: Mon May 2 10:49:34 2016 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/index/IndexServiceImpl.java |  3 +++
 .../java/org/apache/usergrid/rest/NotificationsIT.java   | 11 +++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/12f32eb3/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
index a33453e..0111b31 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexServiceImpl.java
@@ -226,6 +226,9 @@ public class IndexServiceImpl implements IndexService {
                 return Optional.absent();
             }
 
+
+            // never add "none" because it has special meaning, "none" disables indexing
for a type
+            //Do not add "none" to list of required fields!
             fieldsToKeep.remove("none");
 
             defaultProperties.addAll( fieldsToKeep );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/12f32eb3/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
index 61dc419..1655846 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
@@ -78,6 +78,17 @@ public class NotificationsIT extends org.apache.usergrid.rest.test.resource.Abst
 
     @Test
     public void testPaging() throws Exception {
+
+        // this test should work even with indexing turned off for notificaitons collection
+        ArrayList<String> indexingArray = new ArrayList<>(  );
+        indexingArray.add( "none" );
+        Entity payload = new Entity();
+        payload.put( "fields", indexingArray);
+
+        String unIndexedCollectionName = "notifications";
+        app().collection( unIndexedCollectionName ).collection( "_indexes" ).post( payload
);
+        refreshIndex();
+
         // create notifier
         Entity notifier = new Entity().chainPut("name", "mynotifier").chainPut("provider",
"noop");
 


Mime
View raw message