usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [1/2] usergrid git commit: skip users,roles,groups,applications
Date Fri, 04 Sep 2015 13:48:31 GMT
Repository: usergrid
Updated Branches:
  refs/heads/two-dot-o-dev e25f2c39c -> 5bb3249e1


skip users,roles,groups,applications


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

Branch: refs/heads/two-dot-o-dev
Commit: 7a15bd7e8c089d11d377ab9b185491f6069ee711
Parents: c90b642
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Sep 4 07:47:56 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Sep 4 07:47:56 2015 -0600

----------------------------------------------------------------------
 .../corepersistence/service/ApplicationServiceImpl.java      | 8 +++++++-
 .../apache/usergrid/persistence/ApplicationServiceIT.java    | 2 +-
 .../test/java/org/apache/usergrid/rest/SystemResourceIT.java | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/7a15bd7e/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationServiceImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationServiceImpl.java
index 42d5e51..91f8dcd 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationServiceImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/service/ApplicationServiceImpl.java
@@ -26,6 +26,7 @@ import org.apache.usergrid.corepersistence.index.IndexService;
 import org.apache.usergrid.corepersistence.rx.impl.AllEntityIdsObservable;
 import org.apache.usergrid.corepersistence.util.CpNamingUtils;
 import org.apache.usergrid.persistence.EntityRef;
+import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
 import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope;
@@ -37,6 +38,7 @@ import org.apache.usergrid.persistence.map.MapManagerFactory;
 import org.apache.usergrid.persistence.map.MapScope;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
+import org.apache.usergrid.utils.InflectionUtils;
 import rx.Observable;
 
 import static org.apache.usergrid.corepersistence.util.CpNamingUtils.createGraphOperationTimestamp;
@@ -85,7 +87,11 @@ public class ApplicationServiceImpl  implements ApplicationService{
         Observable<Id> countObservable = allEntityIdsObservable.getEntities(appObservable)
             //.map(entity -> eventBuilder.buildEntityDelete(applicationScope, entity.getId()).getEntitiesCompacted())
             .map(entityIdScope -> ((EntityIdScope) entityIdScope).getId())
-            .skip(1)//skip application entity
+            .filter(id -> {
+                final String type = InflectionUtils.pluralize(((Id) id).getType());
+                return ! (type.equals(Schema.COLLECTION_USERS) || type.equals(Schema.COLLECTION_GROUPS)
+                    || type.equals(InflectionUtils.pluralize( Schema.TYPE_APPLICATION)) ||
type.equals(Schema.COLLECTION_ROLES));
+            })//skip application entity
             .map(id -> {
                 entityCollectionManager.mark((Id) id)
                     .mergeWith(graphManager.markNode((Id) id, createGraphOperationTimestamp())).toBlocking().last();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/7a15bd7e/stack/core/src/test/java/org/apache/usergrid/persistence/ApplicationServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/ApplicationServiceIT.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/ApplicationServiceIT.java
index 9b20f72..27ee4ba 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/ApplicationServiceIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/ApplicationServiceIT.java
@@ -70,7 +70,7 @@ public class ApplicationServiceIT extends AbstractCoreIT {
         Observable<Id> ids =
             this.app.getApplicationService().deleteAllEntities(appScope);
         int count = ids.count().toBlocking().last();
-        Assert.assertEquals(count, 13);
+        Assert.assertEquals(count, 10);
         this.app.refreshIndex();
         Thread.sleep(5000);
         Injector injector = SpringResource.getInstance().getBean(Injector.class);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/7a15bd7e/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
index 4523b56..1c19dd3 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/SystemResourceIT.java
@@ -61,7 +61,7 @@ public class SystemResourceIT extends AbstractRestIT {
 
         assertNotNull( result );
         assertNotNull( "ok",result.getStatus() );
-        assertEquals(((LinkedHashMap) result.getData()).get("count"), 3);
+        assertEquals(((LinkedHashMap) result.getData()).get("count"), 0);
     }
 
 


Mime
View raw message