use of org.ovirt.engine.api.model.VnicProfile in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResourceTest method testAddIncompleteParameters.
@Test
public void testAddIncompleteParameters() throws Exception {
VnicProfile model = createIncompleteVnicProfile();
setUriInfo(setUpBasicUriExpectations());
try {
collection.add(model);
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "VnicProfile", "validateParameters", getIncompleteFields());
}
}
use of org.ovirt.engine.api.model.VnicProfile in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResourceTest method doTestBadAddVnicProfile.
private void doTestBadAddVnicProfile(boolean valid, boolean success, String detail) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.AddVnicProfile, AddVnicProfileParameters.class, new String[] {}, new Object[] {}, valid, success));
VnicProfile model = getModel(0);
model.setNetwork(new Network());
model.getNetwork().setId(NETWORK_ID.toString());
try {
collection.add(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
use of org.ovirt.engine.api.model.VnicProfile in project ovirt-engine by oVirt.
the class AbstractBackendVnicProfilesResourceTest method getModel.
static VnicProfile getModel(int index) {
VnicProfile model = new VnicProfile();
model.setId(GUIDS[index].toString());
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
return model;
}
Aggregations