Search in sources :

Example 41 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class FenceValidatorTest method succeedWhenProxyHostAvailable.

@Test
public void succeedWhenProxyHostAvailable() {
    when(proxyLocator.isProxyHostAvailable()).thenReturn(true);
    List<String> messages = new LinkedList<>();
    boolean result = validator.isProxyHostAvailable(new VDS(), messages);
    assertTrue(result);
    assertTrue(messages.isEmpty());
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 42 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class FenceValidatorTest method failWhenNoAgentsExist.

@Test
public void failWhenNoAgentsExist() {
    VDS vds = new VDS();
    vds.setPmEnabled(true);
    List<String> messages = new LinkedList<>();
    boolean result = validator.isPowerManagementEnabledAndLegal(vds, null, messages);
    assertFalse(result);
    assertEquals(2, messages.size());
    assertTrue(messages.contains("ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT"));
    assertTrue(messages.contains("VDS_FENCE_DISABLED"));
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 43 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class FenceValidatorTest method failWhenProxyHostNotAvailable.

@Test
public void failWhenProxyHostNotAvailable() {
    when(proxyLocator.isProxyHostAvailable()).thenReturn(false);
    List<String> messages = new LinkedList<>();
    boolean result = validator.isProxyHostAvailable(new VDS(), messages);
    assertFalse(result);
    assertEquals(1, messages.size());
    assertEquals("VDS_NO_VDS_PROXY_FOUND", messages.get(0));
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 44 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class UpdateStoragePoolCommandTest method addHostsToCluster.

private void addHostsToCluster() {
    VDS host = new VDS();
    List<VDS> hosts = new ArrayList<>();
    hosts.add(host);
    when(vdsDao.getAllForStoragePool(any())).thenReturn(hosts);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) ArrayList(java.util.ArrayList)

Example 45 with VDS

use of org.ovirt.engine.core.common.businessentities.VDS in project ovirt-engine by oVirt.

the class UpgradeHostValidatorTest method setup.

@Before
public void setup() {
    host = new VDS();
    validator = new UpgradeHostValidator(host);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) Before(org.junit.Before)

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