use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class RemoveNetworkCommand method getRemoveExternalNetworkValidationResult.
private ValidationResult getRemoveExternalNetworkValidationResult() {
ProviderNetwork providerNetwork = getNetwork().getProvidedBy();
if (providerNetwork == null || !getParameters().isRemoveFromNetworkProvider()) {
return ValidationResult.VALID;
}
ProviderValidator providerValidator = new ProviderValidator(getProvider());
return providerValidator.validateReadOnlyActions();
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class UpdateNetworkValidatorTest method createProviderNetwork.
private ProviderNetwork createProviderNetwork(Guid providerId) {
final ProviderNetwork result = new ProviderNetwork();
result.setProviderId(providerId);
return result;
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class AddNetworkValidatorTest method externalNetworkNewInDataCenterTestSetup.
private void externalNetworkNewInDataCenterTestSetup(boolean equalToNetwork) {
Network externalNetwork = mock(Network.class);
ProviderNetwork providerNetwork = mock(ProviderNetwork.class);
when(network.getProvidedBy()).thenReturn(providerNetwork);
if (equalToNetwork) {
when(externalNetwork.getProvidedBy()).thenReturn(providerNetwork);
}
networks.add(externalNetwork);
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class AutodefineExternalNetworkCommandTest method testCommandExternalNetwork.
@Test
public void testCommandExternalNetwork() {
setUpPhysicalNetwork(HAS_SHORT_NAME, IS_VM_NETWORK);
physicalNetwork.setProvidedBy(new ProviderNetwork());
Assert.assertFalse(command.validate());
Assert.assertTrue(command.getReturnValue().getValidationMessages().contains(EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_FOR_EXTERNAL_NETWORK.name()));
}
use of org.ovirt.engine.core.common.businessentities.network.ProviderNetwork in project ovirt-engine by oVirt.
the class ImportExternalNetworkCommandTest method getProviderNetworks.
private List<Network> getProviderNetworks() {
ProviderNetwork providerNetwork = new ProviderNetwork();
providerNetwork.setExternalId(EXTERNAL_ID);
providerNetwork.setProviderId(PROVIDER_ID);
Network network = new Network();
network.setProvidedBy(providerNetwork);
return Collections.singletonList(network);
}
Aggregations