Package org.apache.syncope.client.to

Examples of org.apache.syncope.client.to.TaskExecTO


        int executions = taskTO.getExecutions().size();

        if (executions == 0) {
            // generate an execution in order to verify the deletion of a notification task with one or more executions

            TaskExecTO execution = restTemplate.postForObject(
                    BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class, taskTO.getId());
            assertEquals("NOT_SENT", execution.getStatus());

            int i = 0;
            int maxit = 50;

            // wait for task exec completion (executions incremented)
View Full Code Here


        }
        assertNotNull(taskTO);
        assertTrue(taskTO.getExecutions().isEmpty());

        // 4. execute the generated NotificationTask
        TaskExecTO execution = restTemplate.postForObject(
                BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class, taskTO.getId());
        assertNotNull(execution);

        // 5. verify
        taskTO = restTemplate.getForObject(BASE_URL + "task/read/{taskId}", NotificationTaskTO.class,
View Full Code Here

        assertFalse(actual.getUserTemplate().getMemberships().isEmpty());

        // read executions before sync (dryrun test could be executed before)
        int preSyncSize = actual.getExecutions().size();

        TaskExecTO execution =
                restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class, actual.getId());
        assertEquals("JOB_FIRED", execution.getStatus());

        int i = 0;
        int maxit = 50;

        // wait for sync completion (executions incremented)
View Full Code Here

        assertNotNull(task);

        int preSyncSize = task.getExecutions().size();

        // 2. execute the SyncTask for the first time
        TaskExecTO execution = restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class,
                task.getId());
        assertEquals("JOB_FIRED", execution.getStatus());

        int i = 0;
        final int maxit = 20;
        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
            }

            task = restTemplate.getForObject(BASE_URL + "task/read/{taskId}", SyncTaskTO.class, task.getId());

            assertNotNull(task);
            assertNotNull(task.getExecutions());

            i++;
        } while (preSyncSize == task.getExecutions().size() && i < maxit);
        assertEquals(1, task.getExecutions().size());

        // 3. read e-mail address for user created by the SyncTask first execution
        UserTO userTO = restTemplate.getForObject(
                BASE_URL + "user/readByUsername/{username}.json", UserTO.class, "issuesyncope230");
        assertNotNull(userTO);
        String email = userTO.getAttributeMap().get("email").getValues().iterator().next();
        assertNotNull(email);

        // 4. update TESTSYNC on external H2 by changing e-mail address
        JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
        jdbcTemplate.execute("UPDATE TESTSYNC SET email='updatedSYNCOPE230@syncope.apache.org'");

        // 5. re-execute the SyncTask
        execution = restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class,
                task.getId());
        assertEquals("JOB_FIRED", execution.getStatus());

        preSyncSize = task.getExecutions().size();
        i = 0;
        do {
            try {
View Full Code Here

        assertEquals(task.getId(), actual.getId());

        // read executions before sync (dryrun test could be executed before)
        int preSyncSize = actual.getExecutions().size();

        TaskExecTO execution = restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class,
                actual.getId());
        assertEquals("JOB_FIRED", execution.getStatus());

        // wait for sync completion (executions incremented)
        int i = 0;
        final int maxit = 20;
        do {
View Full Code Here

        SyncTaskTO taskTO = restTemplate.postForObject(BASE_URL + "task/update/sync", task, SyncTaskTO.class);
        assertEquals(task.getId(), taskTO.getId());

        int preSyncSize = taskTO.getExecutions().size();

        TaskExecTO execution = restTemplate.postForObject(
                BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class, taskTO.getId());

        assertEquals("JOB_FIRED", execution.getStatus());

        int i = 0;
        int maxit = 50;

        // wait for sync completion (executions incremented)
View Full Code Here

            fill((SyncTask) task, (SyncTaskTO) taskTO);
        }
    }

    public TaskExecTO getTaskExecTO(final TaskExec execution) {
        TaskExecTO executionTO = new TaskExecTO();
        BeanUtils.copyProperties(execution, executionTO, IGNORE_TASK_EXECUTION_PROPERTIES);

        if (execution.getId() != null) {
            executionTO.setId(execution.getId());
        }

        if (execution.getTask() != null && execution.getTask().getId() != null) {
            executionTO.setTask(execution.getTask().getId());
        }

        return executionTO;
    }
View Full Code Here

        assertTrue(taskTO.getExecutions().isEmpty());
    }

    @Test
    public void readExecution() {
        TaskExecTO taskTO = restTemplate.getForObject(BASE_URL + "task/execution/read/{taskId}", TaskExecTO.class, 1);
        assertNotNull(taskTO);
    }
View Full Code Here

        try {
            restTemplate.getForObject(BASE_URL + "task/delete/{taskId}", TaskTO.class, 0);
        } catch (HttpStatusCodeException e) {
            assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
        }
        TaskExecTO execution = restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class, 1);
        assertEquals(PropagationTaskExecStatus.SUBMITTED.name(), execution.getStatus());

        execution = restTemplate.getForObject(BASE_URL + "task/execution/report/{executionId}"
                + "?executionStatus=SUCCESS&message=OK", TaskExecTO.class, execution.getId());
        assertEquals(PropagationTaskExecStatus.SUCCESS.name(), execution.getStatus());
        assertEquals("OK", execution.getMessage());

        restTemplate.getForObject(BASE_URL + "task/delete/{taskId}", PropagationTaskTO.class, 1);
        try {
            restTemplate.getForObject(BASE_URL + "task/execution/read/{executionId}", TaskExecTO.class,
                    execution.getId());
        } catch (HttpStatusCodeException e) {
            assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
        }
    }
View Full Code Here

        assertNotNull(taskTO.getExecutions());

        // read executions before sync (dryrun test could be executed before)
        int preSyncSize = taskTO.getExecutions().size();

        TaskExecTO execution = restTemplate.postForObject(BASE_URL + "task/execute/{taskId}", null, TaskExecTO.class,
                taskTO.getId());
        assertEquals("JOB_FIRED", execution.getStatus());

        int i = 0;
        int maxit = 50;

        // wait for sync completion (executions incremented)
View Full Code Here

TOP

Related Classes of org.apache.syncope.client.to.TaskExecTO

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.