usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject [2/2] usergrid git commit: Added a test proving the issue was fixed.
Date Thu, 05 May 2016 16:59:41 GMT
Added a test proving the issue was fixed.


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

Branch: refs/heads/9f45130_app_cache_fix
Commit: 4c1ece97c588b8f2c8edceaa70796da9873d714c
Parents: a737708
Author: George Reyes <grey@apache.org>
Authored: Thu May 5 09:29:03 2016 -0700
Committer: George Reyes <grey@apache.org>
Committed: Thu May 5 09:29:03 2016 -0700

----------------------------------------------------------------------
 .../collection/CollectionsResourceIT.java       | 70 ++++++++++++++++----
 1 file changed, 58 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/4c1ece97/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
index 9752035..5c98f9c 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/CollectionsResourceIT.java
@@ -17,29 +17,36 @@
 package org.apache.usergrid.rest.applications.collection;
 
 
-import com.fasterxml.jackson.databind.JsonNode;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.ws.rs.ClientErrorException;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.usergrid.persistence.Schema;
 import org.apache.usergrid.persistence.entities.Application;
+import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.Collection;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.model.Token;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.ClientErrorException;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
+import com.fasterxml.jackson.databind.JsonNode;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -311,4 +318,43 @@ public class CollectionsResourceIT extends AbstractRestIT {
         Assert.assertEquals( "Should not be more than one name property", -1, secondFred
);
   */
     }
+
+    @Test
+    public void testBeingAbleToRetreiveMigratedValues() throws Exception {
+
+
+        Entity notifier = new Entity().chainPut("name", "mynotifier").chainPut("provider",
"noop");
+
+        ApiResponse notifierNode = this.pathResource(getOrgAppPath("notifier")).post(ApiResponse.class,notifier);
+
+        UUID uuid = UUIDUtils.newTimeUUID();
+        // create user
+
+        Map payloads = new HashMap<>(  );
+        payloads.put( "mynotifier","hello world" );
+
+        Map statistics = new HashMap<>(  );
+        statistics.put( "sent",1 );
+        statistics.put( "errors",0 );
+
+        Entity payload = new Entity();
+        payload.put("debug", false);
+        payload.put( "expectedCount",0 );
+        payload.put( "finished",1438279671229L);
+        payload.put( "payloads",payloads);
+        payload.put( "priority","normal");
+        payload.put( "state","FINISHED");
+        payload.put( "statistics",statistics);
+
+
+
+
+        ApiResponse user = this.app().collection("notifications/"+ UUIDUtils.newTimeUUID()).put(null,payload
);
+        this.refreshIndex();
+
+        Collection user2 = this.app().collection("notifications").get();
+
+        assertEquals(1,user2.getNumOfEntities());
+
+    }
 }


Mime
View raw message