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/27 19:38:42 UTC

[3/6] incubator-usergrid git commit: iterating query

iterating query


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

Branch: refs/heads/USERGRID-593
Commit: b4d67fcb40c3bcdc46d3b4db2f6a19216a91ec84
Parents: 3a9cfb6
Author: Shawn Feldman <sf...@apache.org>
Authored: Fri Apr 24 11:34:37 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Fri Apr 24 11:34:37 2015 -0600

----------------------------------------------------------------------
 .../persistence/query/IteratingQueryIT.java     | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b4d67fcb/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
index 80c9a54..7aabe6c 100644
--- a/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
+++ b/stack/core/src/test/java/org/apache/usergrid/persistence/query/IteratingQueryIT.java
@@ -111,6 +111,7 @@ public class IteratingQueryIT {
     @Test
     public void singleOrderByBoundRangeScanAscCollection() throws Exception {
         singleOrderByBoundRangeScanAsc( new CollectionIoHelper( app ) );
+
     }
 
 
@@ -549,6 +550,7 @@ public class IteratingQueryIT {
                 expectedResults.add( name );
             }
         }
+        app.refreshIndex();
 
         long stop = System.currentTimeMillis();
 
@@ -620,6 +622,7 @@ public class IteratingQueryIT {
             }
         }
 
+        app.refreshIndex();
         long stop = System.currentTimeMillis();
 
         LOG.info( "Writes took {} ms", stop - start );
@@ -685,6 +688,7 @@ public class IteratingQueryIT {
             }
         }
 
+        app.refreshIndex();
         long stop = System.currentTimeMillis();
 
         LOG.info( "Writes took {} ms", stop - start );
@@ -860,6 +864,7 @@ public class IteratingQueryIT {
             expected.add( name );
         }
 
+        app.refreshIndex();
         long stop = System.currentTimeMillis();
 
         LOG.info( "Writes took {} ms", stop - start );
@@ -918,6 +923,7 @@ public class IteratingQueryIT {
             io.writeEntity( entity );
             expected.add( name );
         }
+        app.refreshIndex();
 
         long stop = System.currentTimeMillis();
 
@@ -946,7 +952,7 @@ public class IteratingQueryIT {
         }
         while ( results.hasCursor() );
 
-        assertEquals( expected.size() - startValue - 1, count );
+        assertEquals( expected.size() - startValue , count );
 
         stop = System.currentTimeMillis();
         LOG.info( "Query took {} ms to return {} entities", stop - start, count );
@@ -979,6 +985,7 @@ public class IteratingQueryIT {
             expected.add( name );
         }
 
+        app.refreshIndex();
         long stop = System.currentTimeMillis();
 
         LOG.info( "Writes took {} ms", stop - start );
@@ -1009,7 +1016,7 @@ public class IteratingQueryIT {
         }
         while ( results.hasCursor() );
 
-        assertEquals( expected.size() - startValue - delta + 1, count );
+        assertEquals( expected.size() - startValue - delta +1 , count );
 
         stop = System.currentTimeMillis();
         LOG.info( "Query took {} ms to return {} entities", stop - start, count );
@@ -1041,6 +1048,7 @@ public class IteratingQueryIT {
             io.writeEntity( entity );
             expected.add( name );
         }
+        app.refreshIndex();
 
         long stop = System.currentTimeMillis();
 
@@ -1097,15 +1105,15 @@ public class IteratingQueryIT {
         for ( int i = 0; i < size; i++ ) {
             Map<String, Object> entity = new HashMap<String, Object>();
             entity.put( "name", String.valueOf( i ) );
-
             io.writeEntity( entity );
         }
 
+        this.app.refreshIndex();
+
         long stop = System.currentTimeMillis();
 
-        LOG.info( "Writes took {} ms", stop - start );
+        LOG.info("Writes took {} ms", stop - start );
 
-        app.refreshIndex();
 
         Query query = new Query();
         query.setLimit( 10 );
@@ -1122,7 +1130,7 @@ public class IteratingQueryIT {
             results = io.getResults( query );
 
             for ( int i = 0; i < results.size(); i++ ) {
-                assertEquals( String.valueOf( count ), results.getEntities().get( i ).getName() );
+                assertEquals( String.valueOf( size - count -1 ), results.getEntities().get( i ).getName() );
                 count++;
             }
 
@@ -1374,6 +1382,7 @@ public class IteratingQueryIT {
 
             io.writeEntity( entity );
         }
+        this.app.refreshIndex();
 
         long stop = System.currentTimeMillis();