Search in sources :

Example 16 with TaskWrapper

use of teammates.common.util.TaskWrapper in project teammates by TEAMMATES.

the class MockTaskQueuer method addTask.

@Override
protected void addTask(String queueName, String workerUrl, Map<String, String> paramMap) {
    Map<String, String[]> multisetParamMap = new HashMap<>();
    paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value }));
    TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap);
    tasksAdded.add(task);
}
Also used : TaskWrapper(teammates.common.util.TaskWrapper) HashMap(java.util.HashMap)

Example 17 with TaskWrapper

use of teammates.common.util.TaskWrapper in project teammates by TEAMMATES.

the class MockTaskQueuer method getNumberOfTasksAdded.

@Override
public Map<String, Integer> getNumberOfTasksAdded() {
    Map<String, Integer> numberOfTasksAdded = new HashMap<>();
    for (TaskWrapper task : tasksAdded) {
        String queueName = task.getQueueName();
        int oldTaskCount = numberOfTasksAdded.getOrDefault(queueName, 0);
        numberOfTasksAdded.put(queueName, oldTaskCount + 1);
    }
    return numberOfTasksAdded;
}
Also used : TaskWrapper(teammates.common.util.TaskWrapper) HashMap(java.util.HashMap)

Example 18 with TaskWrapper

use of teammates.common.util.TaskWrapper in project teammates by TEAMMATES.

the class MockTaskQueuer method addTaskMultisetParam.

@Override
protected void addTaskMultisetParam(String queueName, String workerUrl, Map<String, String[]> paramMap) {
    TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap);
    tasksAdded.add(task);
}
Also used : TaskWrapper(teammates.common.util.TaskWrapper)

Aggregations

TaskWrapper (teammates.common.util.TaskWrapper)18 Test (org.testng.annotations.Test)12 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)9 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)5 HashMap (java.util.HashMap)4 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)4 RedirectResult (teammates.ui.controller.RedirectResult)4 TaskQueuesLogic (teammates.logic.core.TaskQueuesLogic)3 NullPostParameterException (teammates.common.exception.NullPostParameterException)2 ArrayList (java.util.ArrayList)1 FeedbackSessionClosedRemindersAction (teammates.ui.automated.FeedbackSessionClosedRemindersAction)1 FeedbackSessionClosingRemindersAction (teammates.ui.automated.FeedbackSessionClosingRemindersAction)1 FeedbackSessionOpeningRemindersAction (teammates.ui.automated.FeedbackSessionOpeningRemindersAction)1 FeedbackSessionPublishedEmailWorkerAction (teammates.ui.automated.FeedbackSessionPublishedEmailWorkerAction)1 FeedbackSessionRemindEmailWorkerAction (teammates.ui.automated.FeedbackSessionRemindEmailWorkerAction)1 FeedbackSessionRemindParticularUsersEmailWorkerAction (teammates.ui.automated.FeedbackSessionRemindParticularUsersEmailWorkerAction)1 FeedbackSessionUnpublishedEmailWorkerAction (teammates.ui.automated.FeedbackSessionUnpublishedEmailWorkerAction)1 InstructorCourseEnrollSaveAction (teammates.ui.controller.InstructorCourseEnrollSaveAction)1 InstructorCourseInstructorAddAction (teammates.ui.controller.InstructorCourseInstructorAddAction)1 InstructorCourseRemindAction (teammates.ui.controller.InstructorCourseRemindAction)1