use of org.ovirt.engine.api.model.MacPool in project ovirt-engine by oVirt.
the class BackendMacPoolsResourceTest method testAddIncompleteParameters.
@Test
public void testAddIncompleteParameters() throws Exception {
MacPool model = createIncompleteMacPool();
setUriInfo(setUpBasicUriExpectations());
try {
collection.add(model);
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "MacPool", "add", getIncompleteFields());
}
}
use of org.ovirt.engine.api.model.MacPool in project ovirt-engine by oVirt.
the class BackendMacPoolsResourceTest method getModel.
static MacPool getModel(int index) {
MacPool model = new MacPool();
model.setId(GUIDS[index].toString());
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
return model;
}
use of org.ovirt.engine.api.model.MacPool in project ovirt-engine by oVirt.
the class V3MacPoolInAdapter method adapt.
@Override
public MacPool adapt(V3MacPool from) {
MacPool to = new MacPool();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetAllowDuplicates()) {
to.setAllowDuplicates(from.isAllowDuplicates());
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDefaultPool()) {
to.setDefaultPool(from.isDefaultPool());
}
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.isSetRanges()) {
to.setRanges(new Ranges());
to.getRanges().getRanges().addAll(adaptIn(from.getRanges().getRanges()));
}
return to;
}
use of org.ovirt.engine.api.model.MacPool in project ovirt-engine by oVirt.
the class BackendMacPoolResourceTest method testConflictedUpdate.
@Test
public void testConflictedUpdate() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1, 0, false);
MacPool model = getModel(1);
model.setId(GUIDS[1].toString());
try {
resource.update(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyImmutabilityConstraint(wae);
}
}
use of org.ovirt.engine.api.model.MacPool in project ovirt-engine by oVirt.
the class BackendMacPoolResourceTest method getModel.
static MacPool getModel(int index) {
MacPool model = new MacPool();
model.setId(GUIDS[index].toString());
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
return model;
}
Aggregations