use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testGetByIdAll.
@Test
public void testGetByIdAll() {
GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID, true);
assertNotNull(hook);
assertEquals(2, hook.getServerHooks().size());
assertEquals(FixturesTool.HOOK_ID, hook.getId());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testUpdateGlusterHook.
@Test
public void testUpdateGlusterHook() {
GlusterHookEntity existingHook = getGlusterHook();
existingHook.setName(EXISTING_HOOK_NAME);
dao.updateGlusterHook(getGlusterHook());
GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID);
assertNotNull(hook);
assertEquals(existingHook, hook);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method updateGlusterHookConflictStatus.
@Test
public void updateGlusterHookConflictStatus() {
dao.updateGlusterHookConflictStatus(FixturesTool.HOOK_ID, 0);
GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID);
assertNotNull(hook);
assertEquals(Integer.valueOf(0), hook.getConflictStatus());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method getGlusterHook.
private GlusterHookEntity getGlusterHook() {
GlusterHookEntity hook = new GlusterHookEntity();
hook.setId(FixturesTool.HOOK_ID);
hook.setClusterId(FixturesTool.GLUSTER_CLUSTER_ID);
hook.setGlusterCommand(GLUSTER_COMMAND);
hook.setStage(GlusterHookStage.POST);
hook.setName(HOOK_NAME);
hook.setChecksum(CHECKSUM);
hook.setStatus(GlusterHookStatus.DISABLED);
hook.setContentType(GlusterHookContentType.TEXT);
hook.setConflictValue(false, false, false);
return hook;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testRemoveAllButOne.
@Test
public void testRemoveAllButOne() {
GlusterHookEntity newHook = getGlusterHook();
newHook.setId(FixturesTool.NEW_HOOK_ID);
dao.save(newHook);
List<Guid> hookIds = new ArrayList<>();
hookIds.add(FixturesTool.HOOK_ID);
hookIds.add(FixturesTool.HOOK_ID2);
dao.removeAll(hookIds);
List<GlusterHookEntity> hooks = dao.getByClusterId(FixturesTool.GLUSTER_CLUSTER_ID);
assertNotNull(hooks);
assertEquals(1, hooks.size());
}
Aggregations