use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.
the class HostNicStatisticalQuery method clone.
private HostNic clone(HostNic parent) {
HostNic nic = new HostNic();
nic.setId(parent.getId());
nic.setHost(new Host());
nic.getHost().setId(parent.getHost().getId());
return nic;
}
use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.
the class BackendHostNicNetworkAttachmentResourceTest method getModel.
@Override
protected org.ovirt.engine.api.model.NetworkAttachment getModel(int index) {
org.ovirt.engine.api.model.NetworkAttachment model = super.getModel(index);
model.setHostNic(new HostNic());
model.getHostNic().setId(HOST_NIC_ID.toString());
return model;
}
use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.
the class BackendHostNicResourceTest method testGetIncludeStatistics.
@Test
public void testGetIncludeStatistics() throws Exception {
try {
accepts.add("application/xml; detail=statistics");
setUriInfo(setUpBasicUriExpectations());
setGetVdsQueryExpectations(1);
setGetNetworksQueryExpectations(1);
setUpEntityQueryExpectations();
HostNic nic = resource.get();
assertTrue(nic.isSetStatistics());
hostNicsResource.verifyModelSpecific(nic, NIC_IDX);
} finally {
accepts.clear();
}
}
use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.
the class BackendHostNicResourceTest method testStatisticalQuery.
@Test
public void testStatisticalQuery() throws Exception {
VdsNetworkInterface entity = setUpStatisticalExpectations();
@SuppressWarnings("unchecked") BackendStatisticsResource<HostNic, VdsNetworkInterface> statisticsResource = (BackendStatisticsResource<HostNic, VdsNetworkInterface>) resource.getStatisticsResource();
assertNotNull(statisticsResource);
verifyQuery(statisticsResource.getQuery(), entity);
}
use of org.ovirt.engine.api.model.HostNic in project ovirt-engine by oVirt.
the class BackendHostNicsResourceTest method testListIncludeStatistics.
@Test
public void testListIncludeStatistics() throws Exception {
try {
accepts.add("application/xml; detail=statistics");
UriInfo uriInfo = setUpBasicUriExpectations();
setGetVdsQueryExpectations(1);
setGetNetworksQueryExpectations(1);
setUpQueryExpectations("");
collection.setUriInfo(uriInfo);
List<HostNic> nics = getCollection();
assertTrue(nics.get(0).isSetStatistics());
verifyCollection(nics);
} finally {
accepts.clear();
}
}
Aggregations