use of org.ovirt.engine.api.model.Job in project ovirt-engine by oVirt.
the class BackendJobResourceTest method getEntity.
@Override
protected org.ovirt.engine.core.common.job.Job getEntity(int index) {
org.ovirt.engine.core.common.job.Job job = new org.ovirt.engine.core.common.job.Job();
job.setId(GUIDS[index]);
job.setDescription(DESCRIPTIONS[index]);
job.setExternal(true);
job.setAutoCleared(true);
job.setStartTime(new Date());
return job;
}
use of org.ovirt.engine.api.model.Job in project ovirt-engine by oVirt.
the class BackendJobsResourceTest method testAddJob.
@Test
public void testAddJob() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddExternalJob, AddExternalJobParameters.class, new String[] { "Description" }, new Object[] { DESCRIPTIONS[0] }, true, true, GUIDS[0], QueryType.GetJobByJobId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getEntity(0));
Job model = new Job();
model.setDescription(DESCRIPTIONS[0]);
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof Job);
verifyModel((Job) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.Job in project ovirt-engine by oVirt.
the class BackendResource method setJobLink.
protected void setJobLink(final Action action, ActionReturnValue actionResult) {
Job job = new Job();
job.setId(actionResult.getJobId().toString());
LinkHelper.addLinks(job, null, false);
action.setJob(job);
}
use of org.ovirt.engine.api.model.Job in project ovirt-engine by oVirt.
the class GlusterTaskStatisticalQueryTest method getParent.
private Step getParent() {
Step step = new Step();
step.setId(Guid.Empty.toString());
step.setJob(new Job());
step.getJob().setId(Guid.Empty.toString());
return step;
}
use of org.ovirt.engine.api.model.Job in project ovirt-engine by oVirt.
the class StepStatisticalQuery method clone.
private Step clone(Step step) {
// Needed to avoid NPE in LinkHelper due to unsetting of grandparent in LinkHelper#addLinks.
Step cloned = new Step();
cloned.setId(step.getId());
cloned.setJob(new Job());
cloned.getJob().setId(step.getJob().getId());
return cloned;
}