use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class BackendHostResourceTest method setUpStatisticalExpectations.
protected VDS setUpStatisticalExpectations() throws Exception {
VdsStatistics stats = mock(VdsStatistics.class);
VDS entity = mock(VDS.class);
setUpStatisticalEntityExpectations(entity, stats);
setUpGetEntityWithNoCertificateInfoExpectations(1, false, entity);
return entity;
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testStatisticalQuery.
@Test
public void testStatisticalQuery() throws Exception {
VDS entity = setUpStatisticalExpectations();
@SuppressWarnings("unchecked") BackendStatisticsResource<Host, VDS> statisticsResource = (BackendStatisticsResource<Host, VDS>) resource.getStatisticsResource();
assertNotNull(statisticsResource);
verifyQuery(statisticsResource.getQuery(), entity);
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class BackendStatisticResourceTest method setUpQueryExpectations.
private void setUpQueryExpectations(String[] names, boolean link) throws Exception {
VDS entity = getEntity(0);
when(query.resolve(eq(GUIDS[1]))).thenReturn(entity);
List<Statistic> statistics = new ArrayList<>();
for (String name : names) {
statistics.add(getPrototype(name));
}
when(query.getStatistics(same(entity))).thenReturn(statistics);
if (link) {
when(query.getParentType()).thenReturn(Host.class);
}
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class MultipleServicesMonitoringStrategyTest method testCanMoveVdsToMaintenanceFalse.
@Test
public void testCanMoveVdsToMaintenanceFalse() {
VDS vds = new VDS();
vds.setStatus(VDSStatus.PreparingForMaintenance);
vds.setVmCount(1);
assertFalse(strategy.canMoveToMaintenance(vds));
}
use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.
the class MultipleServicesMonitoringStrategyTest method testProcessingHardwareVirt.
@Test
public void testProcessingHardwareVirt() {
doThrow(new RuntimeException()).when(virtStrategy).processHardwareCapabilities(any());
exception.expect(RuntimeException.class);
VDS vds = new VDS();
strategy.processHardwareCapabilities(vds);
}
Aggregations