You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2015/06/02 20:07:47 UTC
[1/2] incubator-usergrid git commit: fix applicationsCreateit
Repository: incubator-usergrid
Updated Branches:
refs/heads/two-dot-o-dev dfd6d2923 -> 68a2af90c
fix applicationsCreateit
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/08db2e31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/08db2e31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/08db2e31
Branch: refs/heads/two-dot-o-dev
Commit: 08db2e31ecbc7b776793d38878cb23047caf38c0
Parents: dfd6d29
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Jun 2 11:55:11 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Jun 2 11:55:11 2015 -0600
----------------------------------------------------------------------
.../apache/usergrid/rest/NotificationsIT.java | 9 +++++++--
.../rest/applications/ApplicationCreateIT.java | 20 +++++++++-----------
2 files changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08db2e31/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
index f7a69c8..81daf88 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/NotificationsIT.java
@@ -77,8 +77,8 @@ public class NotificationsIT extends org.apache.usergrid.rest.test.resource2poin
@Test
public void testPaging() throws Exception {
- int numDevices = 10;
- int numNotifications = 100; // to send to each device
+ int numDevices = 2;
+ int numNotifications = 5; // to send to each device
User user = new User("ed","ed", "ed@anuff.com", "sesame" );
Entity entity = this.app().collection("users").post(user);
@@ -163,6 +163,7 @@ public class NotificationsIT extends org.apache.usergrid.rest.test.resource2poin
StopWatch sw = new StopWatch();
sw.start();
boolean allSent = false;
+ int count = 0;
while (!allSent) {
Thread.sleep(100);
@@ -170,6 +171,10 @@ public class NotificationsIT extends org.apache.usergrid.rest.test.resource2poin
if ( finished == (numDevices * numNotifications) ) {
allSent = true;
}
+ count++;
+ if(count>100){
+ break;
+ }
}
sw.stop();
int nc = numDevices * numNotifications;
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/08db2e31/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
index 25e7280..360db82 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
@@ -77,12 +77,12 @@ public class ApplicationCreateIT extends AbstractRestIT {
@Test
public void testCreateAndImmediateList() throws Exception {
- int appCount = 40;
+ int appCount = 10;
String random = RandomStringUtils.randomAlphabetic(10);
- String orgName = "org_" + random;
- String appName = "app_" + random;
- Token orgAdminToken = getAdminToken(clientSetup.getUsername(), clientSetup.getUsername());
+ String orgName = clientSetup.getOrganizationName();
+ String appName = "testCreateAndImmediateList_app_" + random;
+ Token orgAdminToken = getAdminToken(clientSetup.getUsername(), clientSetup.getPassword());
for ( int i=0; i<appCount; i++ ) {
createAppWithCollection( orgName, appName + i, orgAdminToken, new ArrayList<>() );
@@ -95,7 +95,9 @@ public class ApplicationCreateIT extends AbstractRestIT {
int count = 0;
for ( String name : orgAppResponse.getData().keySet() ) {
- count++;
+ if(name.contains("testcreateandimmediatelist_app")) {
+ count++;
+ }
}
assertEquals( appCount, count );
}
@@ -105,14 +107,10 @@ public class ApplicationCreateIT extends AbstractRestIT {
String orgName, String appName, Token orgAdminToken, List<Entity> entities) {
ApiResponse appCreateResponse = clientSetup.getRestClient()
- .management().orgs().organization( orgName ).app().getResource()
- .queryParam( "access_token", orgAdminToken.getAccessToken() )
- .type( MediaType.APPLICATION_JSON )
- .post( ApiResponse.class, new Application( appName ) );
+ .management().orgs().organization(orgName).app().post(new Application( appName ));
UUID appId = appCreateResponse.getEntities().get(0).getUuid();
- try { Thread.sleep(1000); } catch (InterruptedException ignored ) { }
-
+ refreshIndex();
for ( int i=0; i<5; i++ ) {
final String entityName = "entity" + i;
[2/2] incubator-usergrid git commit: fix collectionsresourceit
Posted by sf...@apache.org.
fix collectionsresourceit
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/68a2af90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/68a2af90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/68a2af90
Branch: refs/heads/two-dot-o-dev
Commit: 68a2af90cc85aa1eaa47cc90c1587bf70427354b
Parents: 08db2e3
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Jun 2 12:07:40 2015 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Jun 2 12:07:40 2015 -0600
----------------------------------------------------------------------
.../applications/collection/CollectionsResourceIT.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/68a2af90/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 0a0133a..06e1088 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
@@ -149,12 +149,13 @@ public class CollectionsResourceIT extends AbstractRestIT {
assertEquals(user.get("email"), email);
this.refreshIndex();
+ String collectionName = "nestprofiles";
//create a permission with the path "me" in it
payload = new Entity();
- payload.put( "permission", "get,post,put,delete:/users/sumeet.agarwal@usergrid.com/**" );
+ payload.put( "permission", "get,post,put,delete:/"+collectionName+"/**" );
//POST to /users/sumeet.agarwal@usergrid.com/permissions
Entity permission = this.app().collection("users").entity(user).collection("permissions").post(payload);
- assertEquals(permission.get("data"), "get,post,put,delete:/users/sumeet.agarwal@usergrid.com/**");
+ assertEquals(permission.get("data"), "get,post,put,delete:/"+collectionName+"/**");
//delete the default role, which would allow all authenticated requests
this.app().collection("role").uniqueID("Default").delete();
@@ -171,13 +172,13 @@ public class CollectionsResourceIT extends AbstractRestIT {
payload.put( "firstname", "sumeet" );
payload.put( "lastname", "agarwal" );
payload.put( "mobile", "122" );
- Entity nestProfile = this.app().collection("nestprofiles").post(payload);
+ Entity nestProfile = this.app().collection(collectionName).post(payload);
assertEquals(nestProfile.get("name"), profileName);
this.refreshIndex();
- Entity nestprofileReturned = this.app().collection("nestprofiles").entity(nestProfile).get();
- assertEquals(nestprofileReturned.get("name"), name);
+ Entity nestprofileReturned = this.app().collection(collectionName).entity(nestProfile).get();
+ assertEquals(nestprofileReturned.get("name"), profileName);
}