use of org.ovirt.engine.core.common.job.StepSubjectEntity in project ovirt-engine by oVirt.
the class StepDaoTest method prepareStartedStepsByStepSubjectEntityTest.
private StepSubjectEntity prepareStartedStepsByStepSubjectEntityTest() {
Guid entityId = Guid.newGuid();
VdcObjectType entityType = VdcObjectType.EXECUTION_HOST;
StepSubjectEntity subjectEntity = new StepSubjectEntity(FixturesTool.STEP_ID, entityType, entityId);
getStepSubjectEntityDao().saveAll(Arrays.asList(subjectEntity));
Step s = dao.get(FixturesTool.STEP_ID);
s.setStatus(JobExecutionStatus.STARTED);
dao.update(s);
return subjectEntity;
}
use of org.ovirt.engine.core.common.job.StepSubjectEntity in project ovirt-engine by oVirt.
the class StepDaoTest method prepareProgressTest.
private void prepareProgressTest(Guid entityId) {
VdcObjectType type = VdcObjectType.Disk;
BaseDisk diskImage = getDiskDao().get(entityId);
assertProgress(null, diskImage);
getStepSubjectEntityDao().saveAll(Arrays.asList(new StepSubjectEntity(FixturesTool.STEP_ID, type, entityId, 30), new StepSubjectEntity(FixturesTool.STEP_ID_2, type, entityId, 50)));
}
use of org.ovirt.engine.core.common.job.StepSubjectEntity in project ovirt-engine by oVirt.
the class StepDaoTest method startedStepsByStepSubjectEntityOtherStatuses.
@Test
public void startedStepsByStepSubjectEntityOtherStatuses() {
StepSubjectEntity subjectEntity = prepareStartedStepsByStepSubjectEntityTest();
Step step = dao.get(FixturesTool.STEP_ID);
Arrays.stream(JobExecutionStatus.values()).filter(status -> status != JobExecutionStatus.STARTED).forEach(status -> {
step.setStatus(status);
dao.update(step);
assertNoStartedStepsForSubjectEntity(subjectEntity);
});
}
use of org.ovirt.engine.core.common.job.StepSubjectEntity in project ovirt-engine by oVirt.
the class StepSubjectEntityDaoTest method getStepSubjectEntityByStepId.
@Test
public void getStepSubjectEntityByStepId() {
List<StepSubjectEntity> entities = dao.getStepSubjectEntitiesByStepId(FixturesTool.STEP_ID);
assertEquals("StepSubjectEntity list not in the expected size", 2, entities.size());
StepSubjectEntity stepSubjectEntity = new StepSubjectEntity(FixturesTool.STEP_ID, VdcObjectType.Storage, FixturesTool.IMAGE_GROUP_ID, 50);
assertSubjectEntityPresence(stepSubjectEntity, entities, true);
}
use of org.ovirt.engine.core.common.job.StepSubjectEntity in project ovirt-engine by oVirt.
the class StepSubjectEntityDaoTest method remove.
@Test
public void remove() {
List<StepSubjectEntity> entities = dao.getStepSubjectEntitiesByStepId(FixturesTool.STEP_ID);
assertEquals("StepSubjectEntity list not in the expected size", 2, entities.size());
assertNotEquals("StepSubjectEntity list elements should be different", entities.get(0), entities.get(1));
StepSubjectEntity toRemove = entities.remove(0);
dao.remove(toRemove.getEntityId(), toRemove.getStepId());
entities = dao.getStepSubjectEntitiesByStepId(FixturesTool.STEP_ID);
assertEquals("StepSubjectEntity list not in the expected size", 1, entities.size());
assertSubjectEntityPresence(toRemove, entities, false);
}
Aggregations