use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class RestartVdsCommand method updateHostInFenceFlow.
private void updateHostInFenceFlow(Guid hostId, boolean isInFenceFlow) {
TransactionSupport.executeInNewTransaction(() -> {
VdsDynamic vdsDynamic = vdsDynamicDao.get(hostId);
vdsDynamic.setInFenceFlow(isInFenceFlow);
vdsDynamicDao.update(vdsDynamic);
return null;
});
}
use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class VdsDynamicDaoTest method generateNewEntity.
@Override
protected VdsDynamic generateNewEntity() {
VdsDynamic newDynamicVds = new VdsDynamic();
newDynamicVds.setId(FixturesTool.VDS_JUST_STATIC_ID);
newDynamicVds.setUpdateAvailable(true);
return newDynamicVds;
}
use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class VdsDynamicDaoTest method testUpdateNetConfigDirty.
@Test
public void testUpdateNetConfigDirty() {
VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
Boolean netConfigDirty = before.getNetConfigDirty();
netConfigDirty = Boolean.FALSE.equals(netConfigDirty);
before.setNetConfigDirty(netConfigDirty);
dao.updateNetConfigDirty(before.getId(), netConfigDirty);
VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
assertEquals(before, after);
}
use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class VdsDynamicDaoTest method testUpdateStatusAndReasons.
@Test
public void testUpdateStatusAndReasons() {
VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
before.setStatus(RandomUtils.instance().nextEnum(VDSStatus.class));
before.setNonOperationalReason(RandomUtils.instance().nextEnum(NonOperationalReason.class));
before.setMaintenanceReason(RandomUtils.instance().nextString(50));
dao.updateStatusAndReasons(before);
VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
assertEquals(before, after);
assertEquals(before.getStatus(), after.getStatus());
assertEquals(before.getNonOperationalReason(), after.getNonOperationalReason());
assertEquals(before.getMaintenanceReason(), after.getMaintenanceReason());
}
use of org.ovirt.engine.core.common.businessentities.VdsDynamic in project ovirt-engine by oVirt.
the class VdsDynamicDaoTest method testUpdateStatus.
@Test
public void testUpdateStatus() {
VdsDynamic before = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
before.setStatus(VDSStatus.Down);
dao.updateStatus(before.getId(), before.getStatus());
VdsDynamic after = dao.get(FixturesTool.VDS_GLUSTER_SERVER2);
assertEquals(before, after);
}
Aggregations