Package com.google.appengine.api.taskqueue

Examples of com.google.appengine.api.taskqueue.Queue.deleteTask()


     */
    @Override
    public void cancelTask(String id) {
      // stop the task
      Queue queue = QueueFactory.getDefaultQueue();
      queue.deleteTask(id);
     
      // remove stored task
      ObjectDatastore datastore = new AnnotationObjectDatastore();
      GaeTask storedTask = datastore.load(GaeTask.class, id);
      if (storedTask != null) {
View Full Code Here


            List<TaskHandle> handles = queue.leaseTasks(30, TimeUnit.MINUTES, 100);
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
        }
    }

    @Test
    public void testPullPayload() throws Exception {
View Full Code Here

            List<TaskHandle> handles = queue.leaseTasks(30, TimeUnit.MINUTES, 100);
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
        }
    }

    @Test
    public void testLeaseTasksOnlyReturnsSpecifiedNumberOfTasks() {
View Full Code Here

        try {
            int countLimit = 1;
            List<TaskHandle> handles = queue.leaseTasks(10, TimeUnit.SECONDS, countLimit);
            assertEquals(countLimit, handles.size());
        } finally {
            queue.deleteTask(th1);
            queue.deleteTask(th2);
        }
    }

}
View Full Code Here

            int countLimit = 1;
            List<TaskHandle> handles = queue.leaseTasks(10, TimeUnit.SECONDS, countLimit);
            assertEquals(countLimit, handles.size());
        } finally {
            queue.deleteTask(th1);
            queue.deleteTask(th2);
        }
    }

}
View Full Code Here

    }

    @Test(expected = IllegalStateException.class)
    public void testDeleteNonExist() {
        Queue nonExistQueue = QueueFactory.getQueue("nonExistQueue");
        nonExistQueue.deleteTask("nonexist");
    }

    @Test
    public void testDelete() {
        String groupTag = "testDelete";
View Full Code Here

            Assert.assertEquals(1, handles.size());
            TaskHandle lh = handles.get(0);
            Assert.assertEquals(th.getName(), lh.getName());
            sync(5000L);
        } finally {
            queue.deleteTask(th);
        }
    }
}
View Full Code Here

            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(30, TimeUnit.MINUTES, 100));
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
        }
    }

    @Test
    public void testPullPayload() throws Exception {
View Full Code Here

            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksAsync(30, TimeUnit.MINUTES, 100));
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
        }
    }

    @Test
    public void testPullWithTag() throws Exception {
View Full Code Here

            List<TaskHandle> handles = waitOnFuture(queue.leaseTasksByTagAsync(30, TimeUnit.MINUTES, 100, "barfoo1"));
            assertFalse(handles.isEmpty());
            TaskHandle lh = handles.get(0);
            assertEquals(th.getName(), lh.getName());
        } finally {
            queue.deleteTask(th);
        }
    }

    @Test
    public void testPullMultipleWithSameTag() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.