Package com.google.appengine.api.taskqueue

Examples of com.google.appengine.api.taskqueue.TaskOptions


    }

    @Test
    public void testAddTaskWithNoName() {
        String testMethodTag = "testAddTaskWithNoName";
        TaskOptions optionsNoName = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .etaMillis(0)
            .url("/queuetask/addentity");
View Full Code Here


    @Test
    public void testTaskNameSpecified() {
        // Add Task with specified name.
        String taskName = "This_is_my_task_name_" + testRunId;
        String testMethodTag = "testTaskNameSpecified";
        TaskOptions optionsHasName = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .taskName(taskName)
            .url("/queuetask/addentity")
View Full Code Here

            .taskAgeLimitSeconds(10)
            .maxBackoffSeconds(10)
            .maxDoublings(10)
            .minBackoffSeconds(10);

        TaskOptions taskOptions = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .retryOptions(retryOptions)
            .url("/queuetask/addentity");
View Full Code Here

    @Test
    public void testRetryOptionViaConfigFile() {
        String testMethodTag = "testRetryOptionViaConfigFile";

        TaskOptions taskOptions = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .url("/queuetask/addentity");
View Full Code Here

    @Test
    public void testUserNameSpace() {
        String testMethodTag = "testUserNameSpace";
        NamespaceManager.set("junittest");

        TaskOptions taskOptions = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .url("/queuetask/addentity");
        // task name explicitly not specified.
View Full Code Here

    @Test
    public void testEtaMillis() {
        String testMethodTag = "testEtaMillis";
        long etaMillis = System.currentTimeMillis() + 10000;
        TaskOptions taskoptions = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .etaMillis(etaMillis);
View Full Code Here

    @Test
    public void testCountdownMillis() {
        String testMethodTag = "testCountdownMillis";
        int countdownMillis = 10000;
        TaskOptions taskoptions = TaskOptions.Builder
            .withMethod(TaskOptions.Method.POST)
            .param(TEST_RUN_ID, testRunId)
            .param(TEST_METHOD_TAG, testMethodTag)
            .countdownMillis(countdownMillis);
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testTransactionalTasksMustBeNamelessSingle() {
        Transaction tx = DatastoreServiceFactory.getDatastoreService().beginTransaction();
        try {
            TaskOptions options = TaskOptions.Builder.withTaskName("foo");
            getDefaultQueue().add(tx, new TaskOptions(options));
        } finally {
            tx.rollback();
        }
    }
View Full Code Here

        String groupTag = "testLeaseTasksByTagBytes";
        String taskBaseName = groupTag + "_" + getTimeStampRandom();
        taskTags.add(taskBaseName);
        byte[] tagBytes = taskBaseName.getBytes();

        TaskOptions options = TaskOptions.Builder
            .withMethod(TaskOptions.Method.PULL)
            .taskName(taskBaseName + "_0")
            .tag(tagBytes)
            .payload("");
        waitOnFuture(queue.addAsync(options));
View Full Code Here

     */
    private List<TaskHandle> addTasks(int count, String taskBaseName,
                                      String groupTag, String payload) {
        ArrayList<TaskOptions> optionList = new ArrayList<TaskOptions>();
        for (int i = 0; i < count; i++) {
            TaskOptions options = TaskOptions.Builder
                .withMethod(TaskOptions.Method.PULL)
                .taskName(taskBaseName + "_" + i)
                .tag(groupTag)
                .payload(payload);
            optionList.add(options);
View Full Code Here

TOP

Related Classes of com.google.appengine.api.taskqueue.TaskOptions

Copyright © 2018 www.massapicom. 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.