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 2014/09/08 23:58:47 UTC

git commit: fixed tests payload increased

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o e3e3a3e9e -> dc968f921


fixed tests
payload increased


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

Branch: refs/heads/two-dot-o
Commit: dc968f9215c51c7f8dfdd80c1ee4894df8d1310f
Parents: e3e3a3e
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Sep 8 15:58:36 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Sep 8 15:58:36 2014 -0600

----------------------------------------------------------------------
 .../AbstractServiceNotificationIT.java          |  1 +
 .../apns/NotificationsServiceIT.java            | 27 ++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc968f92/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
index 7c68b7f..8dcbdaf 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/AbstractServiceNotificationIT.java
@@ -67,6 +67,7 @@ public class AbstractServiceNotificationIT extends AbstractServiceIT {
         long timeout = System.currentTimeMillis() + 60000;
         while (System.currentTimeMillis() < timeout) {
             Thread.sleep(200);
+            app.getEm().refreshIndex();
             notification = app.getEm().get(notification.getUuid(),
                     Notification.class);
             if (notification.getFinished() != null) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dc968f92/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
index 3c44968..c396cee 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
@@ -300,6 +300,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
                 .getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifications", e.getUuid());
 
+        app.getEm().refreshIndex();
+
         Notification notification = app.getEm().get(e.getUuid(),
                 Notification.class);
         assertEquals(
@@ -319,6 +321,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         Entity entity = results.getEntitiesMap().get(notification.getUuid());
         assertNotNull(entity);
 
+        app.getEm().refreshIndex();
+
         try {
             e = app.testRequest(ServiceAction.DELETE, 1, "notifications",
                     e.getUuid()).getEntity();
@@ -378,7 +382,7 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         payloads.clear();
         StringBuilder sb = new StringBuilder();
         sb.append("{\"x\":\"");
-        while (sb.length() < 255) {
+        while (sb.length() < 2048) {
             sb.append("x");
         }
         sb.append("\"}");
@@ -392,7 +396,7 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
             fail("invalid payload should have been rejected");
         } catch (Exception ex) {
             assertEquals(ex.getMessage(),
-                    "java.lang.IllegalArgumentException: Apple APNs payloads must be 256 characters or less");
+                    "java.lang.IllegalArgumentException: Apple APNs payloads must be 2048 characters or less");
             // ok
         }
     }
@@ -501,6 +505,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
 
         Entity e = app.testRequest(ServiceAction.POST, 1, "notifiers")
                 .getEntity();
+        app.getEm().refreshIndex();
+
         app.testRequest(ServiceAction.GET, 1, "notifiers", "apNs2");
 
         Notifier notifier2 = app.getEm().get(e.getUuid(), Notifier.class);
@@ -514,6 +520,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         device2.setProperty(key2, null);
         app.getEm().update(device2);
 
+        app.getEm().refreshIndex();
+
         // create push notification //
 
         app.clear();
@@ -527,6 +535,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         e = app.testRequest(ServiceAction.POST, 1, "notifications").getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifications", e.getUuid());
 
+        app.getEm().refreshIndex();
+
         Notification notification = app.getEm().get(e.getUuid(),
                 Notification.class);
         assertEquals(
@@ -562,6 +572,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
                 .getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifiers", nameValue);
 
+        app.getEm().refreshIndex();
+
         Notifier notifier2 = app.getEm().get(e.getUuid(), Notifier.class);
         assertEquals(notifier2.getName(), nameValue);
         assertEquals(notifier2.getProvider(), PROVIDER);
@@ -571,6 +583,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         device1.setProperty(key2, PUSH_TOKEN);
         app.getEm().update(device1);
 
+        app.getEm().refreshIndex();
+
         // create push notification //
 
         app.clear();
@@ -584,6 +598,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         e = app.testRequest(ServiceAction.POST, 1, "notifications").getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifications", e.getUuid());
 
+        app.getEm().refreshIndex();
+
         Notification notification = app.getEm().get(e.getUuid(),
                 Notification.class);
         assertEquals(
@@ -592,6 +608,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
 
         ns.addDevice(notification, device1);
 
+        app.getEm().refreshIndex();
+
         // perform push //
         notification = scheduleNotificationAndWait(notification);
 
@@ -748,6 +766,7 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         Entity entity = app.testRequest(ServiceAction.POST, 1, "notifiers").getEntity();
         Notifier notifier = app.getEm().get(entity.getUuid(), Notifier.class);
         final String notifierKey = notifier.getName() + NOTIFIER_ID_POSTFIX;
+        app.getEm().refreshIndex();
 
         // create a bunch of devices and add them to the notification
 
@@ -756,6 +775,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
             app.put(notifierKey, PUSH_TOKEN);
             app.put("name", "device"+i*10);
             app.testRequest(ServiceAction.POST, 1, "devices").getEntity();
+            app.getEm().refreshIndex();
+
         }
 
         app.clear();
@@ -768,6 +789,8 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT {
         // create a notification
         entity = app.testRequest(ServiceAction.POST, 1, "notifications").getEntity();
         app.testRequest(ServiceAction.GET, 1, "notifications", entity.getUuid());
+        app.getEm().refreshIndex();
+
         final Notification notification = (Notification) entity.toTypedEntity();
 
         try {