You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/03/20 00:11:02 UTC

[1/2] incubator-usergrid git commit: [USERGRID-493] Made tests use a superuser token by default. If they need other kinds of tokens then they can set them in the tests according to their needs. Fixed

Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-493 3eae925da -> edbda76f2


[USERGRID-493] Made tests use a superuser token by default. If they need other kinds of tokens then they can set them in the tests according to their needs.
Fixed


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

Branch: refs/heads/USERGRID-493
Commit: 298bfcf1cb3a02d8fd10d02d6eab46cdd14b20c9
Parents: 3eae925
Author: GERey <gr...@apigee.com>
Authored: Thu Mar 19 16:08:34 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Thu Mar 19 16:08:34 2015 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/rest/test/resource2point0/ClientSetup.java  | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/298bfcf1/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 252f212..210284b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -109,7 +109,6 @@ public class ClientSetup implements TestRule {
         clientCredentials = restClient.management().orgs().organization( orgName ).credentials().get();
 
         Token token = restClient.management().token().post(Token.class,new Token(username,username));
-        restClient.management().token().setToken( token );
 
         restClient.management().orgs().organization(organization.getName()).app().post(new Application(appName));
 


[2/2] incubator-usergrid git commit: [USERGRID-335] Fixed logic-wise what was wrong with the collectionResourceIT tests.

Posted by gr...@apache.org.
[USERGRID-335] Fixed logic-wise what was wrong with the collectionResourceIT tests.


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

Branch: refs/heads/USERGRID-493
Commit: edbda76f29494cc78ca59afe04138af8a4ecfebf
Parents: 298bfcf
Author: GERey <gr...@apigee.com>
Authored: Thu Mar 19 16:11:01 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Thu Mar 19 16:11:01 2015 -0700

----------------------------------------------------------------------
 .../collection/CollectionsResourceIT.java        | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/edbda76f/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 192fd84..0a0133a 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
@@ -21,12 +21,17 @@ import java.io.IOException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.UniformInterfaceException;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource2point0.model.Collection;
 
+import org.apache.usergrid.rest.test.resource2point0.model.Credentials;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
 import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
+import org.apache.usergrid.rest.test.resource2point0.model.Token;
+
 import org.junit.Ignore;
 import org.junit.Test;
+import org.mortbay.jetty.security.Credential;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -125,6 +130,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
     /**
      * Test posts with a user level token on a path with permissions
      */
+    //TODO: App level permissions aren't functioning.
     @Test
     public void permissionWithMeInString() throws Exception {
 
@@ -154,7 +160,9 @@ public class CollectionsResourceIT extends AbstractRestIT {
         this.app().collection("role").uniqueID("Default").delete();
 
         //log our new user in
-        this.getAppUserToken(username, password);
+        //TODO:App Level token is broken it seems. Test won't work with it.
+        Token appToken = this.getAppUserToken(username, password);
+        management().token().setToken( appToken );
 
         //now post data
         payload = new Entity();
@@ -184,8 +192,9 @@ public class CollectionsResourceIT extends AbstractRestIT {
         Entity payload = new Entity();
         payload.put("summaryOverview", summaryOverview);
         payload.put("caltype", calType);
-        Entity calendarlistOne = this.app().collection(collection).post(payload);
-        assertEquals(calendarlistOne.get("summaryOverview"), summaryOverview);
+
+        Entity calendarlistOne = this.app().collection(collection).post(payload );
+        assertEquals( calendarlistOne.get( "summaryOverview" ), summaryOverview );
         assertEquals(calendarlistOne.get("caltype"), calType);
 
         this.refreshIndex();
@@ -197,7 +206,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         payload.put("summaryOverview", summaryOverviewTwo);
         payload.put("caltype", calTypeTwo);
         Entity calendarlistTwo = this.app().collection(collection).post(payload);
-        assertEquals(calendarlistTwo.get("summaryOverview"), summaryOverviewTwo);
+        assertEquals( calendarlistTwo.get( "summaryOverview" ), summaryOverviewTwo );
         assertEquals(calendarlistTwo.get("caltype"), calTypeTwo);
 
 
@@ -205,7 +214,7 @@ public class CollectionsResourceIT extends AbstractRestIT {
         String query = "summaryOverview = 'My Summary'";
         QueryParameters queryParameters = new QueryParameters().setQuery(query);
         Collection calendarListCollection = this.app().collection(collection).get(queryParameters);
-        assertEquals(calendarListCollection.hasNext(), false);
+        assertEquals(calendarListCollection.hasNext(), true);
 
     }