use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class HotPlugDiskToVmCommandTest method validateFailedDiscardNotSupported.
@Test
public void validateFailedDiscardNotSupported() {
mockVmStatusUp();
mockInterfaceList();
createVirtIODisk();
initStorageDomain();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE)).when(diskVmElementValidator).isPassDiscardSupported(any());
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 CreateSnapshotForVmCommandTest method testVmInPreview.
@Test
public void testVmInPreview() {
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW)).when(snapshotsValidator).vmNotInPreview(any());
doReturn(getEmptyDiskList()).when(cmd).getDisksList();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testVmDuringMigration.
@Test
public void testVmDuringMigration() {
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS)).when(vmValidator).vmNotDuringMigration();
doReturn(getEmptyDiskList()).when(cmd).getDisksList();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testAllDomainsHaveSpaceForAllDisksFailure.
@Test
public void testAllDomainsHaveSpaceForAllDisksFailure() {
doReturn(Collections.emptyList()).when(cmd).getDisksList();
cmd.getParameters().setSaveMemory(true);
doReturn(Guid.newGuid()).when(cmd).getStorageDomainIdForVmMemory(eq(Collections.emptyList()));
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)).when(multipleStorageDomainsValidator).allDomainsHaveSpaceForAllDisks(eq(Collections.emptyList()), any());
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN);
verify(multipleStorageDomainsValidator).allDomainsHaveSpaceForAllDisks(eq(Collections.emptyList()), any());
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testVmRunningStateless.
@Test
public void testVmRunningStateless() {
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS)).when(vmValidator).vmNotRunningStateless();
doReturn(getEmptyDiskList()).when(cmd).getDisksList();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS);
}
Aggregations