You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/06/10 18:45:25 UTC

[03/35] incubator-usergrid git commit: test fix

test fix


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

Branch: refs/heads/rest-test-framework-token-fix
Commit: 8a6e5a32ec7a8cf0d3640cd4ba4d05d94adaeb4d
Parents: 283cc1f
Author: Shawn Feldman <sf...@apache.org>
Authored: Thu Jun 4 16:07:15 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Thu Jun 4 16:07:15 2015 -0600

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


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8a6e5a32/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..f17a088 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,7 @@ 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,13 +106,13 @@ 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 );