use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData in project scheduling by ow2-proactive.
the class ListJobCommandTest method createUserJobInfoList.
private List<UserJobData> createUserJobInfoList(int jobsNumber) {
List<UserJobData> userJobInfoList = new ArrayList<UserJobData>(1);
for (int i = 0; i < jobsNumber; i++) {
JobInfoData jobInfoData = new JobInfoData();
JobIdData jobIdData = new JobIdData();
jobIdData.setId(i);
jobIdData.setReadableName(i + "name");
jobInfoData.setJobId(jobIdData);
jobInfoData.setPriority(JobPriorityData.HIGH);
jobInfoData.setStatus(JobStatusData.FINISHED);
jobInfoData.setStartTime(System.currentTimeMillis() - 1000);
jobInfoData.setFinishedTime(System.currentTimeMillis());
jobInfoData.setJobOwner("test");
jobInfoData.setProjectName("my project");
userJobInfoList.add(new UserJobData(jobInfoData));
}
return userJobInfoList;
}
use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData in project scheduling by ow2-proactive.
the class DataUtility method taskInfo.
public static TaskInfo taskInfo(TaskInfoData d) {
TaskInfoImpl impl = new TaskInfoImpl();
JobIdData jobIdData = d.getJobId();
if (jobIdData != null) {
JobId jobId = jobId(jobIdData);
impl.setJobId(jobId);
TaskId taskId = taskId(jobId, d.getTaskId());
impl.setTaskId(taskId);
}
impl.setExecutionDuration(d.getExecutionDuration());
impl.setExecutionHostName(d.getExecutionHostName());
impl.setInErrorTime(d.getInErrorTime());
impl.setFinishedTime(d.getFinishedTime());
impl.setNumberOfExecutionLeft(d.getNumberOfExecutionLeft());
impl.setNumberOfExecutionOnFailureLeft(d.getNumberOfExecutionOnFailureLeft());
impl.setStartTime(d.getStartTime());
impl.setStatus(TaskStatus.valueOf(d.getTaskStatus().name()));
impl.setName(d.getTaskId().getReadableName());
impl.setProgress(d.getProgress());
impl.setVisualizationActivated(d.isVisualizationActivated());
impl.setVisualizationConnectionString(d.getVisualizationConnectionString());
return impl;
}
use of org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData in project scheduling by ow2-proactive.
the class SchedulerRestWorkflowFromCatalogExecutionTest method testWhenSubmittingUsingAValidWfContentUrlThenAJobIdMustBeRetrieved.
@Test
public void testWhenSubmittingUsingAValidWfContentUrlThenAJobIdMustBeRetrieved() throws Exception {
when(scheduler.submit(Matchers.<Job>any())).thenReturn(new JobIdImpl(77L, "job"));
String workflowUrl = getBaseUriTestWorkflowsServer() + "/workflow";
JobIdData jobId = schedulerRest.submitFromUrl(sessionId, workflowUrl, getEmptyPathSegment(), null);
Assert.assertNotNull(jobId);
Assert.assertEquals(77L, jobId.getId());
Assert.assertEquals("job", jobId.getReadableName());
}
Aggregations