usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [24/33] git commit: Fixed queries in tests
Date Fri, 05 Sep 2014 21:11:27 GMT
Fixed queries in 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/646b98c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/646b98c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/646b98c0

Branch: refs/heads/two-dot-o
Commit: 646b98c0e20571784d048251fc3347fa8ef18798
Parents: 8a20936
Author: grey <greyes@apigee.com>
Authored: Sat Aug 30 13:52:45 2014 -0700
Committer: grey <greyes@apigee.com>
Committed: Sat Aug 30 13:52:45 2014 -0700

----------------------------------------------------------------------
 .../apns/NotificationsServiceIT.java            | 34 ++++++++++++--------
 1 file changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/646b98c0/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 ed15eeb..cba47c4 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
@@ -225,26 +225,31 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT
{
         ns.addDevice(notification, device);
 
         // verify Query for CREATED state
-        Query query = new Query();
-        query.addEqualityFilter("state", Notification.State.STARTED.toString());
+        Query query = Query.fromQL("select * where type = 'notification'");
+//        Query query = new Query();
+//        query.addEqualityFilter("state", Notification.State.STARTED.toString());
         Results results = app.getEm().searchCollection(
                 app.getEm().getApplicationRef(), "notifications", query);
-        Entity entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
+        Notification note = (Notification) results.getEntitiesMap().get(notification.getUuid());
+        assertEquals(Notification.State.STARTED,note.getState());
 
         // perform push //
 
         ns.getQueueManager().processBatchAndReschedule(notification, null);
 
+        //app.getEm().refreshIndex();
         // verify Query for FINISHED state
-        query = new Query();
-        query.addEqualityFilter("state", Notification.State.FINISHED.toString());
+        query = Query.fromQL("select * where type = 'notification'");
+
+//        query = new Query();
+//        query.addEqualityFilter("state", Notification.State.FINISHED.toString());
         results = app.getEm().searchCollection(app.getEm().getApplicationRef(),
                 "notifications", query);
-        entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
 
-        notification = (Notification) entity.toTypedEntity();
+        note = (Notification) results.getEntitiesMap().get(notification.getUuid());
+        assertEquals(Notification.State.FINISHED,note.getState());
+
+        notification = note;
         checkReceipts(notification, 0);
         checkStatistics(notification, 0, 0);
     }
@@ -277,13 +282,14 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT
{
         Thread.sleep(500);
 
         // verify Query for SCHEDULED state
-        Query query = new Query();
-        query.addEqualityFilter("state",
-                Notification.State.SCHEDULED.toString());
+        Query query = Query.fromQL("select * where type = 'notification'");
+//        Query query = new Query();
+//        query.addEqualityFilter("state",
+//                Notification.State.SCHEDULED.toString());
         Results results = app.getEm().searchCollection(
                 app.getEm().getApplicationRef(), "notifications", query);
-        Entity entity = results.getEntitiesMap().get(notification.getUuid());
-        assertNotNull(entity);
+        Notification note = (Notification)results.getEntitiesMap().get(notification.getUuid());
+        assertNotNull(note);
 
         try {
             e = app.testRequest(ServiceAction.DELETE, 1, "notifications",


Mime
View raw message