Search in sources :

Example 11 with GlusterHookEntity

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

the class GlusterHooksDaoTest method testRemove.

@Test
public void testRemove() {
    dao.remove(FixturesTool.HOOK_ID);
    GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID);
    assertNull(hook);
    GlusterServerHook serverhook = dao.getGlusterServerHook(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2);
    assertNull(serverhook);
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) GlusterServerHook(org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook) Test(org.junit.Test)

Example 12 with GlusterHookEntity

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

the class GlusterHooksDaoTest method updateGlusterHookContent.

@Test
public void updateGlusterHookContent() {
    String updateContent = "Updated script content to test";
    String updateChecksum = "ddffeef712fc008f857e77a2f3f179c710";
    dao.updateGlusterHookContent(FixturesTool.HOOK_ID, updateChecksum, updateContent);
    GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID, true);
    assertNotNull(hook);
    assertEquals(updateContent, hook.getContent());
    assertEquals(updateChecksum, hook.getChecksum());
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) Test(org.junit.Test)

Example 13 with GlusterHookEntity

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

the class GlusterHooksDaoTest method testSave.

@Test
public void testSave() {
    GlusterHookEntity newHook = getGlusterHook();
    newHook.setId(FixturesTool.NEW_HOOK_ID);
    dao.save(newHook);
    GlusterHookEntity hook = dao.getById(newHook.getId());
    assertEquals(newHook, hook);
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) Test(org.junit.Test)

Example 14 with GlusterHookEntity

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

the class GlusterHooksDaoTest method testGetHook.

@Test
public void testGetHook() {
    GlusterHookEntity hook = dao.getGlusterHook(FixturesTool.GLUSTER_CLUSTER_ID, GLUSTER_COMMAND, GlusterHookStage.POST, EXISTING_HOOK_NAME);
    assertNotNull(hook);
    assertEquals(EXISTING_HOOK_NAME, hook.getName());
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) Test(org.junit.Test)

Example 15 with GlusterHookEntity

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

the class GlusterHooksDaoTest method testRemoveAllServerHooks.

@Test
public void testRemoveAllServerHooks() {
    dao.removeGlusterServerHooks(FixturesTool.HOOK_ID);
    GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID, true);
    assertTrue(hook.getServerHooks().isEmpty());
}
Also used : GlusterHookEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity) 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