use of org.ovirt.engine.api.model.GlusterBrickAdvancedDetails in project ovirt-engine by oVirt.
the class V3GlusterBrickAdvancedDetailsInAdapter method adapt.
@Override
public GlusterBrickAdvancedDetails adapt(V3GlusterBrickAdvancedDetails from) {
GlusterBrickAdvancedDetails to = new GlusterBrickAdvancedDetails();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDevice()) {
to.setDevice(from.getDevice());
}
if (from.isSetFsName()) {
to.setFsName(from.getFsName());
}
if (from.isSetGlusterClients()) {
to.setGlusterClients(new GlusterClients());
to.getGlusterClients().getGlusterClients().addAll(adaptIn(from.getGlusterClients().getGlusterClients()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetMemoryPools()) {
to.setMemoryPools(new GlusterMemoryPools());
to.getMemoryPools().getGlusterMemoryPools().addAll(adaptIn(from.getMemoryPools().getGlusterMemoryPools()));
}
if (from.isSetMntOptions()) {
to.setMntOptions(from.getMntOptions());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetPid()) {
to.setPid(from.getPid());
}
if (from.isSetPort()) {
to.setPort(from.getPort());
}
return to;
}
use of org.ovirt.engine.api.model.GlusterBrickAdvancedDetails in project ovirt-engine by oVirt.
the class GlusterBrickDetailMapperTest method testWithMultipleClientLists.
@Test
public void testWithMultipleClientLists() {
GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
volDetailsEntity.setBrickDetails(getBrickDetails(2, 2, 2));
GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
assertEquals(2, model.getGlusterClients().getGlusterClients().size());
assertEquals(model.getMntOptions(), volDetailsEntity.getBrickDetails().get(0).getBrickProperties().getMntOptions());
assertEquals(model.getMemoryPools().getGlusterMemoryPools().size(), volDetailsEntity.getBrickDetails().get(0).getMemoryStatus().getMemPools().size());
}
use of org.ovirt.engine.api.model.GlusterBrickAdvancedDetails in project ovirt-engine by oVirt.
the class GlusterBrickDetailMapperTest method testWithNoLists.
@Test
public void testWithNoLists() {
GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
volDetailsEntity.setBrickDetails(getBrickDetails(0, 0, 0));
GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
assertNotNull(model);
assertNull(model.getGlusterClients());
assertNull(model.getMntOptions());
}
use of org.ovirt.engine.api.model.GlusterBrickAdvancedDetails in project ovirt-engine by oVirt.
the class GlusterBrickDetailMapperTest method testWithNullChildObjects.
@Test
public void testWithNullChildObjects() {
GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
volDetailsEntity.setBrickDetails(getBrickDetails(1, 0, 0));
volDetailsEntity.getBrickDetails().get(0).setClients(null);
volDetailsEntity.getBrickDetails().get(0).setMemoryStatus(null);
GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
assertNotNull(model);
assertNull(model.getGlusterClients());
assertEquals(model.getMntOptions(), volDetailsEntity.getBrickDetails().get(0).getBrickProperties().getMntOptions());
assertNull(model.getMemoryPools());
}
use of org.ovirt.engine.api.model.GlusterBrickAdvancedDetails in project ovirt-engine by oVirt.
the class GlusterBrickDetailMapperTest method testWithAllDetails.
@Test
public void testWithAllDetails() {
GlusterVolumeAdvancedDetails volDetailsEntity = new GlusterVolumeAdvancedDetails();
volDetailsEntity.setBrickDetails(getBrickDetails(1, 2, 4));
GlusterBrickAdvancedDetails model = GlusterBrickDetailMapper.map(volDetailsEntity, null);
assertNotNull(model);
assertEquals(2, model.getGlusterClients().getGlusterClients().size());
assertEquals(model.getMntOptions(), volDetailsEntity.getBrickDetails().get(0).getBrickProperties().getMntOptions());
assertEquals(model.getMemoryPools().getGlusterMemoryPools().size(), volDetailsEntity.getBrickDetails().get(0).getMemoryStatus().getMemPools().size());
}
Aggregations