use of org.ovirt.engine.api.model.OpenStackNetworkProvider in project ovirt-engine by oVirt.
the class V3OpenStackNetworkProviderInAdapter method adapt.
@Override
public OpenStackNetworkProvider adapt(V3OpenStackNetworkProvider from) {
OpenStackNetworkProvider to = new OpenStackNetworkProvider();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetAgentConfiguration()) {
to.setAgentConfiguration(adaptIn(from.getAgentConfiguration()));
}
if (from.isSetAuthenticationUrl()) {
to.setAuthenticationUrl(from.getAuthenticationUrl());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPassword()) {
to.setPassword(from.getPassword());
}
if (from.isSetPluginType()) {
to.setPluginType(NetworkPluginType.fromValue(from.getPluginType()));
}
if (from.isSetProperties()) {
to.setProperties(new Properties());
to.getProperties().getProperties().addAll(adaptIn(from.getProperties().getProperties()));
}
if (from.isSetRequiresAuthentication()) {
to.setRequiresAuthentication(from.isRequiresAuthentication());
}
if (from.isSetTenantName()) {
to.setTenantName(from.getTenantName());
}
if (from.isSetUrl()) {
to.setUrl(from.getUrl());
}
if (from.isSetUsername()) {
to.setUsername(from.getUsername());
}
to.setType(OpenStackNetworkProviderType.NEUTRON);
return to;
}
use of org.ovirt.engine.api.model.OpenStackNetworkProvider in project ovirt-engine by oVirt.
the class BackendOpenStackNetworkProviderResourceTest method getModel.
private OpenStackNetworkProvider getModel(int index) {
OpenStackNetworkProvider model = new OpenStackNetworkProvider();
model.setName(NAMES[index]);
model.setType(OpenStackNetworkProviderType.NEUTRON);
model.setDescription(DESCRIPTIONS[index]);
return model;
}
use of org.ovirt.engine.api.model.OpenStackNetworkProvider in project ovirt-engine by oVirt.
the class BackendOpenStackNetworkProviderResourceTest method testConflictedUpdate.
@Test
public void testConflictedUpdate() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpGetEntityExpectations(1);
OpenStackNetworkProvider model = getModel(1);
model.setId(GUIDS[1].toString());
try {
resource.update(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyImmutabilityConstraint(wae);
}
}
Aggregations