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);
}
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);
}
Aggregations