Search in sources :

Example 6 with TransportType

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

the class GlusterVolumeDaoTest method testRemoveTransportTypes.

@Test
public void testRemoveTransportTypes() {
    Set<TransportType> transportTypes = existingReplVol.getTransportTypes();
    assertEquals(2, transportTypes.size());
    assertTrue(transportTypes.contains(TransportType.TCP));
    assertTrue(transportTypes.contains(TransportType.RDMA));
    List<TransportType> types = new ArrayList<>();
    types.add(TransportType.TCP);
    types.add(TransportType.RDMA);
    dao.removeTransportTypes(EXISTING_VOL_REPL_ID, types);
    GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_REPL_ID);
    assertNotNull(volumeAfter);
    transportTypes = volumeAfter.getTransportTypes();
    assertEquals(0, transportTypes.size());
    assertFalse(transportTypes.contains(TransportType.TCP));
    assertFalse(transportTypes.contains(TransportType.RDMA));
    assertFalse(volumeAfter.equals(existingReplVol));
    existingReplVol.removeTransportType(TransportType.TCP);
    existingReplVol.removeTransportType(TransportType.RDMA);
    assertEquals(volumeAfter, existingReplVol);
}
Also used : GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) ArrayList(java.util.ArrayList) TransportType(org.ovirt.engine.core.common.businessentities.gluster.TransportType) Test(org.junit.Test)

Aggregations

TransportType (org.ovirt.engine.core.common.businessentities.gluster.TransportType)6 Test (org.junit.Test)4 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)4 ArrayList (java.util.ArrayList)2 EnumTranslator (org.ovirt.engine.ui.uicompat.EnumTranslator)1 Translator (org.ovirt.engine.ui.uicompat.Translator)1