usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [1/2] usergrid git commit: Fix tests around the new index mapping to include 'size'.
Date Fri, 28 Aug 2015 17:26:17 GMT
Repository: usergrid
Updated Branches:
  refs/heads/two-dot-o-dev 88b64e435 -> 11f5bfeff


Fix tests around the new index mapping to include 'size'.


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

Branch: refs/heads/two-dot-o-dev
Commit: b9d85b3269e49a76c8e6cc7865b1d7f6cb9b48fb
Parents: 1cc7a6a
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Aug 28 10:22:01 2015 -0700
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Aug 28 10:24:04 2015 -0700

----------------------------------------------------------------------
 .../index/impl/EsIndexMappingMigrationPluginTest.java     | 10 ++++++----
 .../applications/collection/users/UserResourceIT.java     |  3 +--
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/b9d85b32/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EsIndexMappingMigrationPluginTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EsIndexMappingMigrationPluginTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EsIndexMappingMigrationPluginTest.java
index 6d61cb1..d4ce9e6 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EsIndexMappingMigrationPluginTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EsIndexMappingMigrationPluginTest.java
@@ -31,7 +31,6 @@ import org.junit.runner.RunWith;
 import org.mockito.Mockito;
 
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 /**
  * Classy class class.
@@ -47,15 +46,18 @@ public class EsIndexMappingMigrationPluginTest extends BaseIT {
     @Inject
     EsProvider provider;
     @Test
-    public void runMigration(){
+    public void runMigration() {
         MigrationInfoSerialization serialization = Mockito.mock(MigrationInfoSerialization.class);
         Mockito.when(serialization.getVersion(Mockito.any())).thenReturn(0);
         EsIndexMappingMigrationPlugin plugin = new EsIndexMappingMigrationPlugin(serialization,provider);
         TestProgressObserver progressObserver = new TestProgressObserver();
         plugin.run(progressObserver);
-        assertFalse( "Progress observer should not have failed", progressObserver.isFailed()
);
-        assertTrue("Progress observer should have update messages", progressObserver.getUpdates().size()
> 0);
 
+        // check for failures
+        assertFalse("Progress observer should not have failed", progressObserver.isFailed());
+
+        // after completed, updates could have size 0 or more (0 if no indices present).
testing observer's 'updates'
+        // size doesn't help.  TODO update test to ensure an index is present before running
 
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/b9d85b32/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
index a387436..b249fea 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
@@ -1070,8 +1070,7 @@ public class UserResourceIT extends AbstractRestIT {
 
             assertNotNull("List must exist", response.getResponse().getEntities());
             assertTrue("Must be some list items", response.getResponse().getEntities().size()
> 0);
-
-            assertTrue("Must be some list items", response.getResponse().getEntities().get(0).keySet().size()
== 3);
+            assertTrue("Should have 4 items - [metadata, size, type, uuid]", response.getResponse().getEntities().get(0).keySet().size()
== 4);
 
         }
     }


Mime
View raw message