Search in sources :

Example 51 with VDS

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;
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) VdsStatistics(org.ovirt.engine.core.common.businessentities.VdsStatistics)

Example 52 with VDS

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);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Host(org.ovirt.engine.api.model.Host) Test(org.junit.Test)

Example 53 with VDS

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);
    }
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Statistic(org.ovirt.engine.api.model.Statistic) ArrayList(java.util.ArrayList)

Example 54 with VDS

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));
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Test(org.junit.Test)

Example 55 with 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);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Test(org.junit.Test)

Aggregations

VDS (org.ovirt.engine.core.common.businessentities.VDS)578 ArrayList (java.util.ArrayList)160 Test (org.junit.Test)138 Guid (org.ovirt.engine.core.compat.Guid)132 List (java.util.List)78 VM (org.ovirt.engine.core.common.businessentities.VM)65 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)55 HashMap (java.util.HashMap)53 HashSet (java.util.HashSet)48 Map (java.util.Map)45 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)42 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)42 Set (java.util.Set)40 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)39 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)39 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)39 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)38 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)38 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)37 Frontend (org.ovirt.engine.ui.frontend.Frontend)35