use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails 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());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails in project ovirt-engine by oVirt.
the class GetGlusterVolumeAdvancedDetailsQueryTest method setupExpectedVolume.
private void setupExpectedVolume() {
expectedVolumeAdvancedDetails = new GlusterVolumeAdvancedDetails();
expectedVolumeAdvancedDetails.setVolumeId(VOLUME_ID);
expectedVolumeAdvancedDetails.setBrickDetails(getBrickDetails());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails in project ovirt-engine by oVirt.
the class GetGlusterVolumeAdvancedDetailsQueryTest method testQueryForNullBrickId.
@Test
public void testQueryForNullBrickId() {
doReturn(VOLUME_ID).when(getQueryParameters()).getVolumeId();
doReturn(null).when(getQueryParameters()).getBrickId();
doReturn(getVds(VDSStatus.Up)).when(glusterUtils).getRandomUpServer(CLUSTER_ID);
getQuery().executeQueryCommand();
GlusterVolumeAdvancedDetails volumeAdvancedDetails = getQuery().getQueryReturnValue().getReturnValue();
assertNotNull(volumeAdvancedDetails);
assertEquals(expectedVolumeAdvancedDetails, volumeAdvancedDetails);
// Brick's server is not fetched, rather clusterUtil is used to fetch a random UP server
verifyZeroInteractions(vdsDao);
verify(glusterUtils, times(1)).getRandomUpServer(CLUSTER_ID);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails in project ovirt-engine by oVirt.
the class GlusterTestHelper method getVolumeAdvancedDetailsEntity.
protected GlusterVolumeAdvancedDetails getVolumeAdvancedDetailsEntity() {
GlusterVolumeAdvancedDetails entity = mock(GlusterVolumeAdvancedDetails.class);
BrickDetails brickDetails = mock(BrickDetails.class);
BrickProperties brickProps = mock(BrickProperties.class);
when(brickProps.getMntOptions()).thenReturn(BRICK_MNT_OPT);
when(brickProps.getPort()).thenReturn(BRICK_PORT);
when(brickDetails.getBrickProperties()).thenReturn(brickProps);
List<BrickDetails> brickDetailsList = Collections.singletonList(brickDetails);
when(entity.getBrickDetails()).thenReturn(brickDetailsList);
return entity;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails in project ovirt-engine by oVirt.
the class GetGlusterVolumeAdvancedDetailsVDSCommand method executeVdsBrokerCommand.
@Override
protected void executeVdsBrokerCommand() {
executeVolumeStatusInfo("");
GlusterVolumeAdvancedDetails volumeAdvancedDetails = result.getVolumeAdvancedDetails();
if (getParameters().isCapacityInfoRequired() || getParameters().isDetailRequired()) {
if (getSucceeded()) {
executeVolumeStatusInfo(GlusterVolumeStatusOption.DETAIL.name().toLowerCase());
if (getSucceeded()) {
volumeAdvancedDetails.copyDetailsFrom(result.getVolumeAdvancedDetails());
}
}
}
if (getParameters().isDetailRequired()) {
if (getSucceeded()) {
executeVolumeStatusInfo(GlusterVolumeStatusOption.CLIENTS.name().toLowerCase());
if (getSucceeded()) {
volumeAdvancedDetails.copyClientsFrom(result.getVolumeAdvancedDetails());
executeVolumeStatusInfo(GlusterVolumeStatusOption.MEM.name().toLowerCase());
if (getSucceeded()) {
volumeAdvancedDetails.copyMemoryFrom(result.getVolumeAdvancedDetails());
}
}
}
}
setReturnValue(volumeAdvancedDetails);
}
Aggregations