usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [10/52] [abbrv] git commit: Fixes for new tests brought in for master.
Date Wed, 03 Sep 2014 22:11:05 GMT
Fixes for new tests brought in for master.


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: 9c47aee00a52b917ab03043cfb0f70a10f86f3f6
Parents: 4e428e3
Author: Dave Johnson <dmjohnson@apigee.com>
Authored: Thu Aug 28 11:06:34 2014 -0400
Committer: Dave Johnson <dmjohnson@apigee.com>
Committed: Thu Aug 28 11:06:34 2014 -0400

----------------------------------------------------------------------
 .../usergrid/batch/job/SchedulerRuntime3IT.java     |  4 +++-
 .../usergrid/batch/job/SchedulerRuntime6IT.java     |  9 +++++++--
 .../usergrid/batch/job/SchedulerRuntime7IT.java     |  5 ++++-
 .../apache/usergrid/persistence/CollectionIT.java   |  2 ++
 .../usergrid/persistence/CountingMutatorIT.java     |  8 +++-----
 .../usergrid/persistence/GeoQueryBooleanTest.java   | 16 +---------------
 .../applications/users/PermissionsResourceIT.java   |  1 +
 7 files changed, 21 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
index 1346e3b..d9a48c6 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime3IT.java
@@ -55,6 +55,8 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
         JobData returned = scheduler.createJob( 
                 "failureJobExceuction", System.currentTimeMillis(), new JobData() );
 
+        scheduler.refreshIndex();
+
         final long waitTime = ( failCount + 2 ) * sleepTime + 5000L ;
 
         boolean jobInvoked = job.waitForCount( waitTime, TimeUnit.MILLISECONDS);
@@ -65,6 +67,7 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
 
         assertTrue( "dead job signaled", deadInvoked );
 
+        scheduler.refreshIndex();
 
         // sleep until the job should have failed. We sleep 1 extra cycle just to
         // make sure we're not racing the test
@@ -75,7 +78,6 @@ public class SchedulerRuntime3IT extends AbstractSchedulerRuntimeIT {
         assertTrue( failCount + " failures resulted", getJobListener().getFailureCount()
== failCount );
         assertTrue( 1 + " success resulted", getJobListener().getSuccessCount() == 1 );
 
-
         JobStat stat = scheduler.getStatsForJob( returned.getJobName(), returned.getUuid()
);
 
         // we should have only marked this as run fail+1 times

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
index 7628f91..4c74f20 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime6IT.java
@@ -55,8 +55,10 @@ public class SchedulerRuntime6IT extends AbstractSchedulerRuntimeIT {
         job.setLatch( numberOfRuns );
         job.setDelay( sleepTime );
 
-        JobData returned = scheduler.createJob( 
-                "onlyOnceExceution", System.currentTimeMillis(), new JobData() );
+
+        getJobListener().setExpected(1);
+
+        JobData returned = scheduler.createJob( "onlyOnceExceution", System.currentTimeMillis(),
new JobData() );
 
         scheduler.refreshIndex();
 
@@ -87,12 +89,15 @@ public class SchedulerRuntime6IT extends AbstractSchedulerRuntimeIT {
 
         assertTrue( "Job slept", slept );
 
+        scheduler.refreshIndex();
 
         //now wait again to see if the job fires one more time, it shouldn't
         waited = getJobListener().blockTilDone( customRetry * numberOfRuns * 2 );
 
         assertFalse( "Job ran twice", waited );
 
+        scheduler.refreshIndex();
+
         stat = scheduler.getStatsForJob( returned.getJobName(), returned.getUuid() );
 
         // we should have only marked this as run once since we delayed further execution

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
index befe5bf..c133f1a 100644
--- a/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/batch/job/SchedulerRuntime7IT.java
@@ -24,7 +24,6 @@ import org.apache.usergrid.persistence.entities.JobStat;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 
@@ -58,10 +57,14 @@ public class SchedulerRuntime7IT extends AbstractSchedulerRuntimeIT {
         JobData returned =
                 scheduler.createJob( "onlyOnceUnlockOnFailExceution", System.currentTimeMillis(),
new JobData() );
 
+        scheduler.refreshIndex();
+
         // sleep until the job should have failed. We sleep 1 extra cycle just to make sure
we're not racing the test
 
         boolean waited = getJobListener().blockTilDone( runLoop * numberOfRuns * 2 + 5000L
);
 
+        scheduler.refreshIndex();
+
         assertTrue( "Both runs executed" , waited);
         assertTrue( "Job failed", getJobListener().getFailureCount() == 1 );
         assertTrue( "No Job succeeded", getJobListener().getSuccessCount() == 1 );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
index d39c794..8ff14de 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CollectionIT.java
@@ -864,6 +864,8 @@ public class CollectionIT extends AbstractCoreIT {
         Entity entity2 = em.create( "game", properties );
         assertNotNull( entity2 );
 
+        em.refreshIndex();
+
 
         // simple not
         Query query = Query.fromQL( "select * where NOT subObjectArray.subField = 'Foo'"
).withLimit( 1 );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
index ddf2dc9..cb1371b 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/CountingMutatorIT.java
@@ -91,12 +91,10 @@ public class CountingMutatorIT extends AbstractCoreIT {
 
 
             Entity connectedEntity = em.create( "user", connectedProps );
+            em.refreshIndex();
 
-            /*Connect from our new entity to our root one so it's updated when paging
-            /
-             */
-
-                 em.createConnection( connectedEntity, "following", returned );
+            // Connect from our new entity to our root one so it's updated when paging
+            em.createConnection( connectedEntity, "following", returned );
         }
 
         //now verify our connections were created properly

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
index 8767a70..738a1c6 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/GeoQueryBooleanTest.java
@@ -17,12 +17,8 @@
 package org.apache.usergrid.persistence;
 
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.inject.Injector;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
@@ -32,21 +28,11 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.AbstractCoreIT;
 import org.apache.usergrid.cassandra.Concurrent;
-import org.apache.usergrid.corepersistence.CpEntityMapUtils;
-import org.apache.usergrid.corepersistence.CpSetup;
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.EntityCollectionManager;
-import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.geo.model.Point;
 import org.apache.usergrid.persistence.index.query.Query;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.field.ListField;
-import org.apache.usergrid.persistence.model.field.value.EntityObject;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 
 @Concurrent()
@@ -129,7 +115,7 @@ public class GeoQueryBooleanTest extends AbstractCoreIT {
 
         log.info( "GeoQueryBooleanTest.testGeoQueryWithOr" );
 
-        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithOr"
);
+        UUID applicationId = setup.createApplication( "testOrganization", "testGeoQueryWithNot"
);
         assertNotNull( applicationId );
 
         EntityManager em = setup.getEmf().getEntityManager( applicationId );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9c47aee0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
index 3d5034a..6855549 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/users/PermissionsResourceIT.java
@@ -265,6 +265,7 @@ public class PermissionsResourceIT extends AbstractRestIT {
                 .type( MediaType.APPLICATION_JSON_TYPE ).delete( String.class ));
 
         assertNull( getError( node ) );
+        refreshIndex(orgname, applicationName);
 
         // grant the perms to reviewer
         addPermission( orgname, applicationName, adminToken, "reviewer", "get,put,post:/reviews/**"
);


Mime
View raw message