use of org.ovirt.engine.api.model.Host in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testCompleteSubFieldAlternatives.
@Test
public void testCompleteSubFieldAlternatives() throws Exception {
Vm vm = new Vm();
vm.setHost(new Host());
vm.getHost().setName("zog");
CompletenessAssertor.validateParameters(vm, "host.id|name");
}
use of org.ovirt.engine.api.model.Host in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testMissingSubField.
@Test
public void testMissingSubField() throws Exception {
Vm vm = new Vm();
vm.setDescription("incomplete");
vm.setHost(new Host());
try {
CompletenessAssertor.validateParameters(vm, "host.id");
fail("expected WebApplicationException on incomplete model");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "Vm", "host.id");
}
}
use of org.ovirt.engine.api.model.Host in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testCompleteSubField.
@Test
public void testCompleteSubField() throws Exception {
Vm vm = new Vm();
vm.setHost(new Host());
vm.getHost().setId("0");
CompletenessAssertor.validateParameters(vm, "host.id");
}
use of org.ovirt.engine.api.model.Host in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testCompleteParameters.
@Test
public void testCompleteParameters() throws Exception {
Vm vm = new Vm();
vm.setName("foo");
vm.setStatus(VmStatus.UP);
vm.setHost(new Host());
CompletenessAssertor.validateParameters(vm, "name", "host", "status");
}
use of org.ovirt.engine.api.model.Host in project ovirt-engine by oVirt.
the class BackendHostNicsResource method addParents.
@Override
public HostNic addParents(HostNic hostNic) {
final HostNic nic = super.addParents(hostNic);
final Host host = new Host();
host.setId(hostId);
nic.setHost(host);
if (nic.getPhysicalFunction() != null) {
nic.getPhysicalFunction().setHost(host);
}
return nic;
}
Aggregations