Search in sources :

Example 6 with NetworkFilterParameter

use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.

the class BackendVmNicFilterParameterResourceTest method testUpdate.

@Test
public void testUpdate() throws Exception {
    setUpGetEntityExpectations(1);
    setUriInfo(setUpActionExpectations(ActionType.UpdateVmNicFilterParameter, VmNicFilterParameterParameters.class, new String[] { "VmId" }, new Object[] { VM_ID }, true, true));
    NetworkFilterParameter parameter = resource.update(getParameter());
    assertNotNull(parameter);
}
Also used : VmNicFilterParameterParameters(org.ovirt.engine.core.common.action.VmNicFilterParameterParameters) RemoveVmNicFilterParameterParameters(org.ovirt.engine.core.common.action.RemoveVmNicFilterParameterParameters) NetworkFilterParameter(org.ovirt.engine.api.model.NetworkFilterParameter) Test(org.junit.Test)

Example 7 with NetworkFilterParameter

use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.

the class BackendVmNicFilterParametersResourceTest method getModel.

static NetworkFilterParameter getModel(int index) {
    NetworkFilterParameter model = new NetworkFilterParameter();
    model.setName(NAMES[index]);
    model.setId(GUIDS[index].toString());
    model.setValue(NAMES[index]);
    return model;
}
Also used : NetworkFilterParameter(org.ovirt.engine.api.model.NetworkFilterParameter)

Example 8 with NetworkFilterParameter

use of org.ovirt.engine.api.model.NetworkFilterParameter in project ovirt-engine by oVirt.

the class BackendVmNicFilterParametersResourceTest method testAddIncompleteParameters.

@Test
public void testAddIncompleteParameters() throws Exception {
    NetworkFilterParameter model = new NetworkFilterParameter();
    setUriInfo(setUpBasicUriExpectations());
    try {
        collection.add(model);
        fail("expected WebApplicationException on incomplete parameters");
    } catch (WebApplicationException wae) {
        verifyIncompleteException(wae, "NetworkFilterParameter", "add", "value");
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) NetworkFilterParameter(org.ovirt.engine.api.model.NetworkFilterParameter) Test(org.junit.Test)

Aggregations

NetworkFilterParameter (org.ovirt.engine.api.model.NetworkFilterParameter)8 Test (org.junit.Test)4 WebApplicationException (javax.ws.rs.WebApplicationException)2 VmNicFilterParameterParameters (org.ovirt.engine.core.common.action.VmNicFilterParameterParameters)2 Response (javax.ws.rs.core.Response)1 NetworkFilterParameters (org.ovirt.engine.api.model.NetworkFilterParameters)1 RemoveVmNicFilterParameterParameters (org.ovirt.engine.core.common.action.RemoveVmNicFilterParameterParameters)1 VmNicFilterParameter (org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1