usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [10/14] incubator-usergrid git commit: tests are passing
Date Wed, 04 Mar 2015 17:25:19 GMT
tests are passing


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

Branch: refs/heads/two-dot-o
Commit: b9408de8a604bebe500428eea8871dafd0362d2e
Parents: 2b31015
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Mar 3 16:38:57 2015 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Mar 3 16:38:57 2015 -0700

----------------------------------------------------------------------
 .../corepersistence/CpEntityManagerFactory.java |  1 -
 .../corepersistence/StaleIndexCleanupTest.java  | 30 +++++++++-----------
 .../cassandra/EntityManagerFactoryImplIT.java   |  1 -
 3 files changed, 13 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 84fad36..a4e91b5 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -321,7 +321,6 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
             em.delete(appToDelete);
             // create new Entity in deleted_appinfos collection, with same UUID and properties
as deleted appinfo
             em.create("deleted_appinfo", appToDelete.getProperties());
-            em.refreshIndex();
         }
 
         // delete the application's index

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 54f0e93..82d8f93 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -336,21 +336,20 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         final EntityManager em = app.getEntityManager();
 
-        final int numEntities = 20;
-        final int numUpdates = 40;
+        final int numEntities = 10;
+        final int numUpdates = 5;
 
         // create lots of entities
-        final List<Entity> things = new ArrayList<Entity>(numEntities);
+        final List<Entity> dogs = new ArrayList<Entity>(numEntities);
         for ( int i=0; i<numEntities; i++) {
-            final String thingName = "thing" + i;
-            things.add( em.create("thing", new HashMap<String, Object>() {{
-                put("name", thingName);
+            final String dogName = "dog" + i;
+            dogs.add( em.create("dog", new HashMap<String, Object>() {{
+                put("name", dogName);
             }}));
-//            Thread.sleep( writeDelayMs );
         }
         em.refreshIndex();
 
-        CandidateResults crs = queryCollectionCp( "things", "thing", "select *");
+        CandidateResults crs = queryCollectionCp( "dogs", "dog", "select *");
         Assert.assertEquals( "Expect no stale candidates yet", numEntities, crs.size() );
 
         // turn off post processing stuff that cleans up stale entities
@@ -360,16 +359,13 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
 
         List<Entity> maxVersions = new ArrayList<>(numEntities);
         int count = 0;
-        for ( Entity thing : things ) {
+        for ( Entity dog : dogs ) {
             Entity toUpdate = null;
 
             for ( int j=0; j<numUpdates; j++) {
-                toUpdate = em.get( thing.getUuid() );
+                toUpdate = em.get( dog.getUuid() );
                 toUpdate.setProperty( "property"  + j, RandomStringUtils.randomAlphanumeric(10));
-
                 em.update(toUpdate);
-
-                Thread.sleep( writeDelayMs );
                 count++;
                 if ( count % 100 == 0 ) {
                     logger.info("Updated {} of {} times", count, numEntities * numUpdates);
@@ -383,11 +379,11 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         // wait for indexes to be cleared for the deleted entities
         count = 0;
         do {
-            if(count>0){Thread.sleep(200);}
-            crs = queryCollectionCp("things", "thing", "select *");
-        } while ( crs.size() == numEntities && count++ < 1000 );
+            Thread.sleep(100);
+            crs = queryCollectionCp("dogs", "dog", "select *");
+        } while ( crs.size() == numEntities && count++ < 15 );
 
-        Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),numEntities);
+        Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),
numEntities);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b9408de8/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 0ca6e8b..e5f8709 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
@@ -52,7 +52,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-@NotThreadSafe
 public class EntityManagerFactoryImplIT extends AbstractCoreIT {
 
     private static final Logger logger = LoggerFactory.getLogger( EntityManagerFactoryImplIT.class
);


Mime
View raw message