Search in sources :

Example 16 with JobIdData

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;
}
Also used : JobInfoData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobInfoData) JobIdData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData) UserJobData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.UserJobData) ArrayList(java.util.ArrayList)

Example 17 with JobIdData

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;
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) TaskIdImpl.createTaskId(org.ow2.proactive.scheduler.task.TaskIdImpl.createTaskId)

Example 18 with JobIdData

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());
}
Also used : JobIdData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) Test(org.junit.Test)

Aggregations

JobIdData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData)9 IOException (java.io.IOException)7 File (java.io.File)5 FileInputStream (java.io.FileInputStream)5 JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)4 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)4 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)4 SubmissionClosedException (org.ow2.proactive.scheduler.common.exception.SubmissionClosedException)4 FileOutputStream (java.io.FileOutputStream)3 InputStream (java.io.InputStream)3 KeyManagementException (java.security.KeyManagementException)3 KeyStoreException (java.security.KeyStoreException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 ArrayList (java.util.ArrayList)3 TimeoutException (java.util.concurrent.TimeoutException)3 POST (javax.ws.rs.POST)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 Test (org.junit.Test)3 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)3