Search in sources :

Example 81 with GlusterBrickEntity

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

the class GetGlusterVolumeBricksQueryTest method setupExpectedVolume.

private void setupExpectedVolume() {
    expected = new GlusterVolumeEntity();
    expected.setId(Guid.newGuid());
    brickEntity = new GlusterBrickEntity();
    brickEntity.setId(Guid.newGuid());
    brickEntity.setServerId(Guid.newGuid());
    brickEntity.setBrickDirectory("/tmp/b1");
    brickEntity.setStatus(GlusterStatus.DOWN);
    bricks.add(brickEntity);
    expected.setBricks(bricks);
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)

Example 82 with GlusterBrickEntity

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

the class GetGlusterVolumeProfileInfoQueryTest method getBrick.

private GlusterBrickEntity getBrick() {
    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setBrickDirectory("dir");
    brick.setServerName("host");
    return brick;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)

Example 83 with GlusterBrickEntity

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

the class GlusterVolumeRemoveBricksCommandTest method getBricks.

private List<GlusterBrickEntity> getBricks(Guid volumeId, int max) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    for (Integer i = 0; i < max; i++) {
        GlusterBrickEntity brick1 = new GlusterBrickEntity();
        brick1.setVolumeId(volumeId);
        brick1.setServerName("server1");
        brick1.setStatus(GlusterStatus.UP);
        brick1.setBrickDirectory("/tmp/s" + i.toString());
        bricks.add(brick1);
    }
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Example 84 with GlusterBrickEntity

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

the class ReplaceGlusterVolumeBrickCommandTest method getBricks.

private List<GlusterBrickEntity> getBricks(Guid volumeId, String dirPrefix, int n) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    GlusterBrickEntity brick;
    for (Integer i = 0; i < n; i++) {
        brick = new GlusterBrickEntity();
        brick.setVolumeId(volumeId);
        brick.setServerId(serverId);
        brick.setServerName(serverName);
        brick.setBrickDirectory("/tmp/" + dirPrefix + i.toString());
        brick.setStatus(GlusterStatus.UP);
        bricks.add(brick);
    }
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Example 85 with GlusterBrickEntity

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

the class AbstractRemoveGlusterVolumeBricksCommandTest method getInvalidBricks.

protected List<GlusterBrickEntity> getInvalidBricks(Guid volumeId) {
    List<GlusterBrickEntity> bricks = new ArrayList<>();
    GlusterBrickEntity brick1 = new GlusterBrickEntity();
    brick1.setVolumeId(volumeId);
    brick1.setBrickDirectory("/tmp/test-vol1");
    brick1.setServerId(SERVER_ID);
    brick1.setStatus(GlusterStatus.UP);
    bricks.add(brick1);
    GlusterBrickEntity brick2 = new GlusterBrickEntity();
    brick2.setVolumeId(volumeId);
    brick2.setBrickDirectory("/tmp/test-vol122");
    brick2.setServerId(SERVER_ID);
    brick2.setStatus(GlusterStatus.UP);
    bricks.add(brick2);
    return bricks;
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) ArrayList(java.util.ArrayList)

Aggregations

GlusterBrickEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity)132 ArrayList (java.util.ArrayList)63 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)43 Test (org.junit.Test)28 Guid (org.ovirt.engine.core.compat.Guid)19 GlusterAsyncTask (org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask)14 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)13 VDS (org.ovirt.engine.core.common.businessentities.VDS)11 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)11 List (java.util.List)10 HashMap (java.util.HashMap)9 Map (java.util.Map)9 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)9 BrickProperties (org.ovirt.engine.core.common.businessentities.gluster.BrickProperties)9 GlusterVolumeRemoveBricksParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters)7 BrickDetails (org.ovirt.engine.core.common.businessentities.gluster.BrickDetails)7 GlusterVolumeAdvancedDetails (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails)7 GlusterVolumeType (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType)7 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)7 Iterator (java.util.Iterator)5