You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/04/01 00:58:25 UTC

[41/50] incubator-usergrid git commit: Add wait to lookupApplication()

Add wait to lookupApplication()


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

Branch: refs/heads/USERGRID-509
Commit: e61179305c98a58168bfd672ea46ee789d0fe32a
Parents: 2eca36f
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Mar 30 09:50:23 2015 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Mar 30 09:50:23 2015 -0400

----------------------------------------------------------------------
 .../cassandra/EntityManagerFactoryImplIT.java           | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/e6117930/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
index d52f3f6..b64f0b5 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImplIT.java
@@ -166,7 +166,15 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         // attempt to get entities in application's collections in various ways should all fail
 
-        assertNull( setup.getEmf().lookupApplication( orgName + "/" + appName ));
+        for ( int i=0; i<maxRetries; i++ ) {
+            found = ( setup.getEmf().lookupApplication( orgName + "/" + appName ) != null );
+            if ( found ) {
+                Thread.sleep( 500 );
+            } else {
+                break;
+            }
+        }
+        assertFalse( "Lookup of deleted app must fail", found );
 
         // app must not be found in apps collection
 
@@ -182,6 +190,8 @@ public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
         // restore the app
 
+        emf.refreshIndex();
+
         emf.restoreApplication( deletedAppId );
 
         emf.rebuildAllIndexes(new EntityManagerFactory.ProgressObserver() {