use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class StorageDomainToPoolRelationValidatorTest method testAttachFailDomainTypeIncorrect.
@Test
public void testAttachFailDomainTypeIncorrect() {
storageDomain.setStorageType(StorageType.LOCALFS);
ValidationResult attachIncorrectTypeResult = validator.validateDomainCanBeAttachedToPool();
assertThat(attachIncorrectTypeResult, failsWith(EngineMessage.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH));
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class StorageDomainValidatorTest method discardAfterDeleteNotSupportedByUnderlyingStorage.
@Test
public void discardAfterDeleteNotSupportedByUnderlyingStorage() {
ValidationResult result = new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_UNDERLYING_STORAGE, String.format("$storageDomainName %s", domain.getName()));
assertDiscardAfterDeleteUpdate(true, StorageType.ISCSI, false, result);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class RunVmValidatorTest method validateDisksPassDiscardFails.
@Test
public void validateDisksPassDiscardFails() {
EngineMessage failureEngineMessage = EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE;
mockPassDiscardSupport(new ValidationResult(failureEngineMessage));
VM vm = new VM();
vm.setId(Guid.newGuid());
assertThat(runVmValidator.validateDisksPassDiscard(vm), failsWith(failureEngineMessage));
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class RunVmValidatorTest method canRunVmAsStateless.
private void canRunVmAsStateless(boolean autoStartUp, final boolean vmInPreview, boolean isVmStateless, Boolean isStatelessParam, boolean shouldPass, EngineMessage message) {
Guid vmId = Guid.newGuid();
when(snapshotValidator.vmNotInPreview(vmId)).thenReturn(vmInPreview ? new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW) : ValidationResult.VALID);
VM vm = new VM();
vm.setId(vmId);
vm.setAutoStartup(autoStartUp);
vm.setStateless(isVmStateless);
validateResult(runVmValidator.validateStatelessVm(vm, isStatelessParam), shouldPass, message);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class VmNicMacsUtilsTest method testValidateThereIsEnoughOfFreeMacsNoAllocations.
@Test
public void testValidateThereIsEnoughOfFreeMacsNoAllocations() {
final ValidationResult actual = underTest.validateThereIsEnoughOfFreeMacs(singletonList(vmNetworkInterfaceMock), macPoolMock, ALWAYS_FALSE);
assertThat(actual, isValid());
}
Aggregations