usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [14/52] [abbrv] usergrid git commit: Do not add "none" to list of required fields!
Date Mon, 23 May 2016 14:16:57 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/d8371e1a
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/d8371e1a
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/d8371e1a

Branch: refs/heads/asf-site
Commit: d8371e1a64d7f8004233f171eb9ddb79b7166f70
Parents: f505e59
Author: Dave Johnson <snoopdave@apache.org>
Authored: Mon Apr 18 08:26:37 2016 -0400
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Mon Apr 18 08:26:37 2016 -0400

----------------------------------------------------------------------
 .../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/d8371e1a/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 ad997c8..9509626 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
+            fieldsToKeep.remove("none");
+
             defaultProperties.addAll( fieldsToKeep );
         }
         else {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/d8371e1a/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