Search in sources :

Example 26 with GlusterHookEntity

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

Example 27 with GlusterHookEntity

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

Example 28 with GlusterHookEntity

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

Example 29 with GlusterHookEntity

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

Example 30 with GlusterHookEntity

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());
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid) Test(org.junit.Test)

Aggregations

GlusterHookEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity)34 Test (org.junit.Test)13 ArrayList (java.util.ArrayList)11 GlusterServerHook (org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook)8 Guid (org.ovirt.engine.core.compat.Guid)6 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)5 GlusterHookParameters (org.ovirt.engine.core.common.action.gluster.GlusterHookParameters)5 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)5 List (java.util.List)4 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)4 ActionType (org.ovirt.engine.core.common.action.ActionType)3 GlusterClusterParameters (org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters)3 GlusterHookManageParameters (org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 GlusterHookContentType (org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType)3 GlusterHookStatus (org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus)3 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)3 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)3 Frontend (org.ovirt.engine.ui.frontend.Frontend)3 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)3