use of org.ovirt.engine.core.common.businessentities.gluster.TransportType in project ovirt-engine by oVirt.
the class VolumeTransportTypeRenderer method render.
@Override
public String render(Set<TransportType> transportTypes) {
Translator transportTypeTranslator = EnumTranslator.getInstance();
StringBuilder transportTypesBuilder = new StringBuilder();
Iterator<TransportType> iterator = transportTypes.iterator();
while (iterator.hasNext()) {
TransportType transportType = iterator.next();
transportTypesBuilder.append(transportTypeTranslator.translate(transportType));
if (iterator.hasNext()) {
// $NON-NLS-1$
transportTypesBuilder.append(", ");
}
}
return transportTypesBuilder.toString();
}
use of org.ovirt.engine.core.common.businessentities.gluster.TransportType in project ovirt-engine by oVirt.
the class GlusterVolumeDaoTest method testAddTransportType.
@Test
public void testAddTransportType() {
Set<TransportType> transportTypes = existingDistVol.getTransportTypes();
assertEquals(1, transportTypes.size());
assertFalse(transportTypes.contains(TransportType.RDMA));
dao.addTransportType(EXISTING_VOL_DIST_ID, TransportType.RDMA);
GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_DIST_ID);
assertNotNull(volumeAfter);
transportTypes = volumeAfter.getTransportTypes();
assertEquals(2, transportTypes.size());
assertTrue(transportTypes.contains(TransportType.RDMA));
assertFalse(volumeAfter.equals(existingDistVol));
existingDistVol.addTransportType(TransportType.RDMA);
assertEquals(volumeAfter, existingDistVol);
}
use of org.ovirt.engine.core.common.businessentities.gluster.TransportType in project ovirt-engine by oVirt.
the class GlusterVolumeDaoTest method testRemoveTransportType.
@Test
public void testRemoveTransportType() {
Set<TransportType> transportTypes = existingReplVol.getTransportTypes();
assertEquals(2, transportTypes.size());
assertTrue(transportTypes.contains(TransportType.RDMA));
dao.removeTransportType(EXISTING_VOL_REPL_ID, TransportType.RDMA);
GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_REPL_ID);
assertNotNull(volumeAfter);
transportTypes = volumeAfter.getTransportTypes();
assertEquals(1, transportTypes.size());
assertFalse(transportTypes.contains(TransportType.RDMA));
assertFalse(volumeAfter.equals(existingReplVol));
existingReplVol.removeTransportType(TransportType.RDMA);
assertEquals(volumeAfter, existingReplVol);
}
use of org.ovirt.engine.core.common.businessentities.gluster.TransportType in project ovirt-engine by oVirt.
the class CreateGlusterVolumeVDSCommand method getTransportTypeArr.
private String[] getTransportTypeArr(GlusterVolumeEntity volume) {
Set<TransportType> transportTypes = volume.getTransportTypes();
if (transportTypes == null) {
return null;
}
String[] transportTypeArr = new String[transportTypes.size()];
int index = 0;
for (TransportType transportType : transportTypes) {
transportTypeArr[index++] = transportType.name();
}
return transportTypeArr;
}
use of org.ovirt.engine.core.common.businessentities.gluster.TransportType in project ovirt-engine by oVirt.
the class GlusterVolumeDaoTest method testAddTransportTypes.
@Test
public void testAddTransportTypes() {
Set<TransportType> transportTypes = existingDistVol.getTransportTypes();
assertEquals(1, transportTypes.size());
dao.removeTransportType(EXISTING_VOL_DIST_ID, TransportType.TCP);
transportTypes = dao.getById(EXISTING_VOL_DIST_ID).getTransportTypes();
assertEquals(0, transportTypes.size());
List<TransportType> types = new ArrayList<>();
types.add(TransportType.TCP);
types.add(TransportType.RDMA);
dao.addTransportTypes(EXISTING_VOL_DIST_ID, types);
GlusterVolumeEntity volumeAfter = dao.getById(EXISTING_VOL_DIST_ID);
assertNotNull(volumeAfter);
transportTypes = volumeAfter.getTransportTypes();
assertEquals(2, transportTypes.size());
assertTrue(transportTypes.contains(TransportType.TCP));
assertTrue(transportTypes.contains(TransportType.RDMA));
assertFalse(volumeAfter.equals(existingDistVol));
existingDistVol.addTransportType(TransportType.TCP);
existingDistVol.addTransportType(TransportType.RDMA);
assertEquals(volumeAfter, existingDistVol);
}
Aggregations