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());
}
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"));
}
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));
}
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);
}
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);
}
Aggregations