use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.RestPage in project scheduling by ow2-proactive.
the class SchedulerStateRestTaskCentricTest method testGetTaskStatesByTagNoSorting.
@Test
public void testGetTaskStatesByTagNoSorting() throws Throwable {
int nbTasksInPage = 50;
int nbTotalTasks = 100;
String jobIdStr = "1";
String tag = "TAG-TEST";
Page<TaskState> expectedPage = RestTestUtils.newMockedTaskStatePage(jobIdStr, tag, nbTasksInPage, nbTotalTasks);
when(mockOfScheduler.getTaskStates(anyString(), anyLong(), anyLong(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean(), anyInt(), anyInt(), any(SortSpecifierContainer.class))).thenReturn(expectedPage);
RestPage<TaskStateData> page = restInterface.getTaskStatesByTag(sessionId, tag, 0, 0, false, true, true, true, 0, nbTasksInPage, new SortSpecifierContainer());
RestTestUtils.assertTaskStates(expectedPage, page);
}
use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.RestPage in project scheduling by ow2-proactive.
the class ListTaskStatesCommandTest method testCommandJobIdOnly.
@Test
public void testCommandJobIdOnly() throws Exception {
when(restApi.getJobTaskStates(anyString(), eq(jobId))).thenReturn(new RestPage(taskData, taskData.size()));
executeTest(jobId);
String out = capturedOutput.toString();
System.out.println(out);
assertThat(out, containsString("ID NAME"));
assertThat(out, containsString("task1"));
assertThat(out, containsString("task2"));
assertThat(out, containsString("task3"));
assertThat(out, containsString("task4"));
assertThat(out, containsString("task5"));
assertThat(out, containsString("task6"));
}
use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.RestPage in project scheduling by ow2-proactive.
the class ListTaskStatesCommandTest method testCommandJobIdTag.
@Test
public void testCommandJobIdTag() throws Exception {
when(restApi.getJobTaskStatesByTag(anyString(), eq(jobId), eq(tag))).thenReturn(new RestPage(taskDataFiltered, taskDataFiltered.size()));
executeTest(jobId, tag);
String out = capturedOutput.toString();
System.out.println(out);
assertThat(out, containsString("ID NAME"));
assertThat(out, containsString("task1"));
assertThat(out, containsString("task2"));
assertThat(out, containsString("task3"));
assertThat(out, not(containsString("task4")));
assertThat(out, not(containsString("task5")));
assertThat(out, not(containsString("task6")));
}
Aggregations