Search in sources :

Example 16 with JobState

use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.

the class SchedulerStateRestPaginationTest method testGetJobTaskStatesByTagPaginated.

@Test
public void testGetJobTaskStatesByTagPaginated() throws Throwable {
    JobState job = newMockedJob(jobIdStr, nbTasks);
    when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job);
    List<TaskStateData> res = restInterface.getJobTaskStatesByTagPaginated(sessionId, jobIdStr, "", 0, nbTasks).getList();
    assertEquals("Number of tasks is incorrect", nbTasks, res.size());
}
Also used : TaskStateData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskStateData) JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Example 17 with JobState

use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.

the class SchedulerStateRestPaginationTest method testGetJobTaskStatesPaginated.

@Test
public void testGetJobTaskStatesPaginated() throws Throwable {
    JobState job = newMockedJob(jobIdStr, nbTasks);
    when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job);
    List<TaskStateData> res = restInterface.getJobTaskStatesPaginated(sessionId, jobIdStr, 0, nbTasks).getList();
    assertEquals("Number of tasks is incorrect", nbTasks, res.size());
}
Also used : TaskStateData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskStateData) JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Example 18 with JobState

use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.

the class SchedulerStateRestTaskCentricTest method testGetJobTasksIdsByTagPaginated.

@Test
public void testGetJobTasksIdsByTagPaginated() throws Throwable {
    int nbTasks = 50;
    String jobIdStr = "1";
    JobState job = RestTestUtils.newMockedJob(jobIdStr, "", nbTasks);
    when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job);
    RestPage<String> page = restInterface.getTasksNamesPaginated(sessionId, jobIdStr, 0, nbTasks);
    RestTestUtils.assertTasks(nbTasks, jobIdStr, page);
}
Also used : JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Example 19 with JobState

use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.

the class SchedulerStateRestTaskCentricTest method testGetJobTasksIdsPaginated.

@Test
public void testGetJobTasksIdsPaginated() throws Throwable {
    int nbTasks = 50;
    String jobIdStr = "1";
    JobState job = RestTestUtils.newMockedJob(jobIdStr, "", nbTasks);
    when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job);
    RestPage<String> page = restInterface.getTasksNamesPaginated(sessionId, jobIdStr, 0, nbTasks);
    RestTestUtils.assertTasks(nbTasks, jobIdStr, page);
}
Also used : JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Example 20 with JobState

use of org.ow2.proactive.scheduler.common.job.JobState in project scheduling by ow2-proactive.

the class SchedulerStateRestTaskCentricTest method testGetJobTaskStatesPaginated.

@Test
public void testGetJobTaskStatesPaginated() throws Throwable {
    int nbTasks = 50;
    String jobIdStr = "1";
    JobState job = RestTestUtils.newMockedJob(jobIdStr, null, nbTasks);
    when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job);
    List<TaskStateData> res = restInterface.getJobTaskStatesPaginated(sessionId, jobIdStr, 0, nbTasks).getList();
    assertEquals("Number of tasks is incorrect", nbTasks, res.size());
}
Also used : TaskStateData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.TaskStateData) JobState(org.ow2.proactive.scheduler.common.job.JobState) Test(org.junit.Test)

Aggregations

JobState (org.ow2.proactive.scheduler.common.job.JobState)67 Test (org.junit.Test)34 JobId (org.ow2.proactive.scheduler.common.job.JobId)28 TaskState (org.ow2.proactive.scheduler.common.task.TaskState)25 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)23 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)19 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)17 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)17 UnknownJobRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.UnknownJobRestException)15 ArrayList (java.util.ArrayList)14 NotConnectedRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException)14 PermissionRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException)14 GET (javax.ws.rs.GET)13 Path (javax.ws.rs.Path)13 Produces (javax.ws.rs.Produces)13 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)13 File (java.io.File)12 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)9 ClientJobState (org.ow2.proactive.scheduler.job.ClientJobState)9 TaskStatesPage (org.ow2.proactive.scheduler.common.task.TaskStatesPage)8