use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class GetGlusterVolumeAdvancedDetailsQueryTest method getBrick.
private GlusterBrickEntity getBrick() {
GlusterBrickEntity brick = new GlusterBrickEntity();
brick.setId(BRICK_ID);
brick.setServerId(SERVER_ID);
return brick;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class StartRebalanceGlusterVolumeCommandTest method getBricks.
private List<GlusterBrickEntity> getBricks(Guid volumeId, int n) {
List<GlusterBrickEntity> bricks = new ArrayList<>();
GlusterBrickEntity brick;
for (Integer i = 0; i < n; i++) {
brick = new GlusterBrickEntity();
brick.setVolumeId(volumeId);
brick.setBrickDirectory("/tmp/test-vol" + i.toString());
brick.setStatus(GlusterStatus.UP);
bricks.add(brick);
}
return bricks;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class GlusterCoreUtilTest method createBrick.
private static GlusterBrickEntity createBrick(Guid serverId, String serverName, String brickDir) {
GlusterBrickEntity brick = new GlusterBrickEntity();
brick.setId(Guid.newGuid());
brick.setServerId(serverId);
brick.setServerName(serverName);
brick.setBrickDirectory(brickDir);
return brick;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class GlusterBrickDaoTest method testAddAllBrickProperties.
@Test
public void testAddAllBrickProperties() {
Guid brickId1 = FixturesTool.GLUSTER_BRICK_UUID1;
Guid brickId2 = FixturesTool.GLUSTER_BRICK_UUID2;
GlusterBrickEntity brick1 = dao.getById(brickId1);
GlusterBrickEntity brick2 = dao.getById(brickId2);
brick1.setBrickDetails(new BrickDetails());
BrickProperties brickProperties1 = new BrickProperties();
brickProperties1.setBrickId(brickId1);
brickProperties1.setFreeSize(Long.valueOf("75000"));
brickProperties1.setTotalSize(Long.valueOf("250000"));
brick1.getBrickDetails().setBrickProperties(brickProperties1);
brick2.setBrickDetails(new BrickDetails());
BrickProperties brickProperties2 = new BrickProperties();
brickProperties2.setBrickId(brickId2);
brickProperties2.setFreeSize(Long.valueOf("175000"));
brickProperties2.setTotalSize(Long.valueOf("275000"));
brick2.getBrickDetails().setBrickProperties(brickProperties2);
List<GlusterBrickEntity> bricksToAdd = new ArrayList<>();
bricksToAdd.add(brick1);
bricksToAdd.add(brick2);
dao.addBrickProperties(bricksToAdd);
brick1 = dao.getById(brickId1);
assertNotNull(brick1);
assertNotNull(brick1.getBrickProperties());
assertEquals(250000, brick1.getBrickProperties().getTotalSize(), 0.0);
assertEquals(75000, brick1.getBrickProperties().getFreeSize(), 0.0);
brick2 = dao.getById(brickId2);
assertNotNull(brick2);
assertNotNull(brick2.getBrickProperties());
assertEquals(275000, brick2.getBrickProperties().getTotalSize(), 0.0);
assertEquals(175000, brick2.getBrickProperties().getFreeSize(), 0.0);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity in project ovirt-engine by oVirt.
the class GlusterBrickDaoTest method testRemove.
@Test
public void testRemove() {
GlusterBrickEntity existingBrick = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1);
assertNotNull(existingBrick);
dao.removeBrick(FixturesTool.GLUSTER_BRICK_UUID1);
assertNull(dao.getById(FixturesTool.GLUSTER_BRICK_UUID1));
}
Aggregations