Search in sources :

Example 1 with AccessProtocol

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

the class GlusterVolumeDaoTest method testRemoveAccessProtocol.

@Test
public void testRemoveAccessProtocol() {
    Set<AccessProtocol> protocols = existingReplVol.getAccessProtocols();
    assertEquals(2, protocols.size());
    assertTrue(protocols.contains(AccessProtocol.NFS));
    dao.removeAccessProtocol(EXISTING_VOL_REPL_ID, AccessProtocol.NFS);
    GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_REPL_ID);
    assertNotNull(volumeAfter);
    protocols = volumeAfter.getAccessProtocols();
    assertEquals(1, protocols.size());
    assertFalse(protocols.contains(AccessProtocol.NFS));
    assertFalse(volumeAfter.equals(existingReplVol));
    existingReplVol.removeAccessProtocol(AccessProtocol.NFS);
    assertEquals(volumeAfter, existingReplVol);
}
Also used : AccessProtocol(org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) Test(org.junit.Test)

Example 2 with AccessProtocol

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

the class GlusterVolumeDaoTest method testAddAccessProtocol.

@Test
public void testAddAccessProtocol() {
    Set<AccessProtocol> protocols = existingDistVol.getAccessProtocols();
    assertEquals(1, protocols.size());
    assertFalse(protocols.contains(AccessProtocol.NFS));
    dao.addAccessProtocol(EXISTING_VOL_DIST_ID, AccessProtocol.NFS);
    GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_DIST_ID);
    assertNotNull(volumeAfter);
    protocols = volumeAfter.getAccessProtocols();
    assertEquals(2, protocols.size());
    assertTrue(protocols.contains(AccessProtocol.NFS));
    assertFalse(volumeAfter.equals(existingDistVol));
    existingDistVol.addAccessProtocol(AccessProtocol.NFS);
    assertEquals(volumeAfter, existingDistVol);
}
Also used : AccessProtocol(org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AccessProtocol (org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol)2 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)2