use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class UpdateVmDiskCommandTest method validateDiscardFailedNotSupportedByDiskInterface.
@Test
public void validateDiscardFailedNotSupportedByDiskInterface() {
when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage());
initializeCommand();
when(diskVmElementValidator.isPassDiscardSupported(any())).thenReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE));
ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class UpdateVmDiskCommandTest method validateFailedVMHasNotDisk.
@Test
public void validateFailedVMHasNotDisk() throws Exception {
initializeCommand();
createNullDisk();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST)).when(diskValidator).isDiskExists();
ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class AmendImageGroupVolumesCommandTest method testValidationFailsDiskConnectedToRunningVm.
@Test
public void testValidationFailsDiskConnectedToRunningVm() {
when(diskValidator.isDiskPluggedToAnyNonDownVm(false)).thenReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN));
ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class TransferDiskImageCommandTest method validateCantUploadIllegalImage.
@Test
public void validateCantUploadIllegalImage() {
initializeSuppliedImage();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL, "")).when(diskImagesValidator).diskImagesNotIllegal();
getCommand().validate();
ValidateTestUtils.assertValidationMessages("Can't start a transfer for an illegal image.", getCommand(), EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class TransferDiskImageCommandTest method validateCantUploadLockedImage.
@Test
public void validateCantUploadLockedImage() {
initializeSuppliedImage();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED, "")).when(diskImagesValidator).diskImagesNotLocked();
getCommand().validate();
ValidateTestUtils.assertValidationMessages("Can't start a transfer for a locked image.", getCommand(), EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED);
}
Aggregations