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 <sfeld...@apache.org> Authored: Tue Jun 2 11:55:11 2015 -0600 Committer: Shawn Feldman <sfeld...@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", "e...@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;