use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParameterResourceTest method getParameter.
protected NetworkFilterParameter getParameter() {
NetworkFilterParameter parameter = new NetworkFilterParameter();
parameter.setId(PARAMETER_ID.toString());
// parameter.setVmInterfaceId(VM_NIC_ID);
parameter.setValue(VALUES[DEFAULT_INDEX]);
parameter.setName(NAMES[DEFAULT_INDEX]);
return parameter;
}
use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParametersResourceTest method testAddParameter.
@Test
public void testAddParameter() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddVmNicFilterParameter, VmNicFilterParameterParameters.class, new String[] { "VmId" }, new Object[] { VM_ID }, true, true, PARAMETER_ID, QueryType.GetVmInterfaceFilterParameterById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { PARAMETER_ID }, asList(getEntity(0)));
NetworkFilterParameter model = getModel(0);
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof NetworkFilterParameter);
verifyModel((NetworkFilterParameter) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParametersResourceTest method doTestBadAddNic.
private void doTestBadAddNic(boolean valid, boolean success, String detail) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.AddVmNicFilterParameter, VmNicFilterParameterParameters.class, new String[] { "VmId" }, new Object[] { VM_ID }, valid, success));
NetworkFilterParameter model = getModel(0);
try {
collection.add(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParametersResource method list.
@Override
public NetworkFilterParameters list() {
NetworkFilterParameters parameters = new NetworkFilterParameters();
List<VmNicFilterParameter> entities = getBackendCollection(QueryType.GetVmInterfaceFilterParametersByVmInterfaceId, new IdQueryParameters(nicId));
for (VmNicFilterParameter entity : entities) {
NetworkFilterParameter parameter = populate(map(entity), entity);
parameters.getNetworkFilterParameters().add(addLinks(parameter));
}
return parameters;
}
use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParameterResourceTest method testGet.
@Test
public void testGet() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1);
NetworkFilterParameter parameter = resource.get();
verifyModel(parameter, DEFAULT_INDEX);
}
Aggregations