usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [5/8] incubator-usergrid git commit: observable test
Date Fri, 05 Jun 2015 16:42:46 GMT
observable test


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

Branch: refs/heads/USERGRID-652
Commit: e69dd20da73a209c29c1fb7d1d0608d898f6de10
Parents: 283cc1f
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Thu Jun 4 16:08:08 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Thu Jun 4 16:08:08 2015 -0600

----------------------------------------------------------------------
 .../rx/AllEntitiesInSystemObservableIT.java       | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e69dd20d/stack/core/src/test/java/org/apache/usergrid/corepersistence/rx/AllEntitiesInSystemObservableIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/rx/AllEntitiesInSystemObservableIT.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/rx/AllEntitiesInSystemObservableIT.java
index e3c8e1c..7dfc1ec 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/rx/AllEntitiesInSystemObservableIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/rx/AllEntitiesInSystemObservableIT.java
@@ -22,6 +22,7 @@ package org.apache.usergrid.corepersistence.rx;
 
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.junit.Test;
 
@@ -96,6 +97,8 @@ public class AllEntitiesInSystemObservableIT extends AbstractCoreIT {
         final ApplicationScope scope = CpNamingUtils.getApplicationScope( app.getId() );
         final GraphManager gm = managerCache.getGraphManager( scope );
 
+
+        AtomicLong counter = new AtomicLong();
         allEntitiesInSystemObservableImpl.getData().doOnNext( new Action1<EntityIdScope>()
{
             @Override
             public void call( final EntityIdScope entityIdScope ) {
@@ -104,17 +107,18 @@ public class AllEntitiesInSystemObservableIT extends AbstractCoreIT
{
                 assertNotNull(entityIdScope.getId());
 
                 // we should only emit each node once
-                if ( entityIdScope.getId().getType().equals( type1 ) ) {
-                    assertTrue( "Element should be present on removal",
-                        type1Identities.remove(entityIdScope.getId() ) );
-                }
-                else if ( entityIdScope.getId().getType().equals( type2 ) ) {
-                    assertTrue( "Element should be present on removal",
-                        type2Identities.remove(entityIdScope.getId() ) );
+                final Id id = entityIdScope.getId();
+                if ( id.getType().equals( type1 ) ) {
+                    boolean removed =  type1Identities.remove(id);
+                    assertTrue( "Element(a:"+counter.incrementAndGet()+") should be present
on removal",type1Identities.size() ==0 || removed);
+                } else if ( id.getType().equals( type2 ) ) {
+                    boolean removed = type2Identities.remove(id );
+                    assertTrue( "Element(b:"+counter.incrementAndGet()+") should be present
on removal",type2Identities.size() ==0 || removed );
                 }
             }
         } ).toBlocking().lastOrDefault( null );
 
+
         // there should now be no type1 or type2 entities
 
         assertEquals( "Every element should have been encountered", 0, type1Identities.size()
);


Mime
View raw message