use of org.ovirt.engine.api.model.Cluster in project ovirt-engine by oVirt.
the class BackendResourceTest method testBadGuidValidation.
@Test(expected = MalformedIdException.class)
public void testBadGuidValidation() throws Exception {
setUpGetEntityExpectations(false);
Host host = new Host();
host.setCluster(new Cluster());
host.getCluster().setId("!!!");
resource.update(host);
}
use of org.ovirt.engine.api.model.Cluster in project ovirt-engine by oVirt.
the class AbstractBackendCpuProfilesResourceTest method doTestBadAddCpuProfile.
private void doTestBadAddCpuProfile(boolean valid, boolean success, String detail) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.AddCpuProfile, CpuProfileParameters.class, new String[] {}, new Object[] {}, valid, success));
CpuProfile model = getModel(0);
model.setCluster(new Cluster());
model.getCluster().setId(CLUSTER_ID.toString());
try {
collection.add(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
use of org.ovirt.engine.api.model.Cluster in project ovirt-engine by oVirt.
the class BackendAffinityGroupResourceTest method getModel.
static AffinityGroup getModel(int index) {
AffinityGroup model = new AffinityGroup();
model.setId(GUIDS[0].toString());
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
model.setCluster(new Cluster());
model.getCluster().setId(CLUSTER_ID.toString());
model.setEnforcing((GUIDS[index].hashCode() & 1) == 0);
model.setPositive((GUIDS[index].hashCode() & 1) == 1);
return model;
}
Aggregations